The 28-year old climber is the current Austrian road race and time-trial champion and holds six professional victories to his name
"I needed this victory," said Valverde on the Vuelta website. "I had winning legs and I fancied victory today."
The 183.2km stage from Onda ended with a brief but brutal 4.1km climb which quickly split the pack.
With three kilometres to go, Nairo Quintana accelerated and was followed by only Movistar team-mate Valverde, Primoz Roglic of Jumbo-Visma and Astana's Lopez.
"I think in the end we saw who were the riders one step above the rest," Colombia's Lopez said.
Lopez's compatriot Quintana set the pace until the final kilometre, creating the springboard for his Spanish team-mate. Valverde, riding his home tour wearing the world champion's rainbow jersey, charged for the line in the final metres.
"It's even more special with the rainbow jersey," said Valverde. He also thanked Quintana but said the plan had not entirely worked.
"We wanted to drop Primoz Roglic and 'Superman' Lopez, but they were very strong too and it just wasn't possible," he said.
Valverde was chased home by Slovenian Roglic.
"A short but sweet climb and we know Valverde is good at this," Roglic told Eurosport.
Lopez rolled in six seconds later, expending less energy but still ensuring he regained the overall lead from Belgian Dylan Teuns, who struggled on the climbs.
Quintana was fourth having also done his job for his team.
After the stage, those four top the overall standings. Lopez is six seconds ahead of Roglic with the 39-year-old Valverde 16 back and Quintana at 27.
"There is a lot of La Vuelta left, but it seems today's top four are the strongest of the race at this point," said Valverde.
At 39, Valverde became the third oldest stage winner in any of the three Grand Tours, following American Chris Horner, who won a Vuelta stage at 41 in 2013, and Belgian Pino Cerami who was also 41 when he won on the 1963 Tour de France.
In a race so far marked by breakaways, Saturday's eighth stage is a hilly 166.9km ride from Valls to Igualada where the flat finish could give the sprinters a chance, if the pack stays together.
The 28-year old climber is the current Austrian road race and time-trial champion and holds six professional victories to his name
Boult has taken 317 wickets for New Zealand in 78 Test matches, 62 wickets in Twenty20 cricket and is top of the one-day international bowling rankings
The Qualifiers involving UAE, Kuwait, Hong Kong and Singapore will be hosted by Oman from August 20 to 24
The hosts will now play Ecuador on November 20, 24 hours earlier than planned
The team will be based in Abu Dhabi
Men's team wins bronze in open section
His wife seeks compensation for snapshots of his corpse that were circulated after the helicopter accident
The tennis legend revealed impending retirement plans yesterday