The 39-year-old Valverde, wearing the defending world champion's jersey, remained strong in the challenging final climb to finish just ahead of second-place Primoz Roglic at the end of the 183-kilometer (113-mile) stage from Onda to Mas de la Costa in eastern Spain. Lopez crossed the line six seconds behind Valverde, followed by Nairo Quintana and Rafal Majka.
It was the 12th stage win in the Vuelta for Valverde, who moved to third place overall, 10 seconds behind second-place Roglic and 16 seconds behind Lopez. Quintana, Valverde's Movistar teammate, was 27 seconds off the lead in fourth place.
"We kept a good rhythm throughout the stage and in the end we were able to pull off the victory," Valverde said. "I was feeling very confident. There is still a long way to go but right now we are strong."
Lopez, a Colombian racing for Astana Pro Team, will be wearing the leader's red jersey for the third time in this year's Vuelta. He will be one of the favorites on Saturday when riders face a hilly 166.9-kilometer stage that starts in Valls and finishes with a sprint in Igualada after a steep climb of more than 7 kilometers.
"In the end we were able to stay close," Lopez said. "We will keep going little by little. There is no reason to worry. There is still a long way to go and it will be very demanding." Belgian rider Dylan Teuns entered Friday's stage in the overall lead but finished nearly 10 minutes behind Valverde, dropping to 18th in the general classification.
American Tejay van Garderen abandoned the race a day after being involved in a crash. His Education First teammates Rigoberto Uran and Hugh Carthy had already pulled out after crashing on Thursday.
More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports