Spaniard Luis Perez Rodriguez (Caja Sur) won Thursday's 153.5km 18th stage of the Tour of Spain between Talavera de la Reina and Avila.
Russia's Denis Menchov (Rabobank) retained the leader's gold jersey.
Rodriguez, who announced his retirement at the end of the Vuelta on Sunday, finished 41 seconds ahead of a dozen riders which included Menchov and his main rivals, Spaniard Carlos Sastre (CSC) and Australian Cadel Evans (Predictor-Lotto).
Evans and Sastre moved into second and third place respectively overall after this 18th stage, while Russian Vladimir Efimkin (Caisse d'Epargne) slipped from second to fifth place after arriving more than three minutes behind the winner.
"I'm the happiest person in the world," said Rodriguez, 33. The stage was
decided during the first climb on the category one Mijares with Sastre
attacking to try and close the gap on Menchov who fought on doggedly to retain first place overall.
However the breakaway caused problems behind with Efimkin slipping from second to fifth place after arriving more than three minutes behind the Menchov group.
"I knew that it was going to be a complicated stage in a tactical sense with a very difficult first climb," Menchov said. "When Sastre attacked, I had to respond. I think Sastre is the most dangerous."
There remains really only one more mountain stage, on Friday between Avila and Alto de Abantos, for Menchov's adversaries to surpass him.
World road race champion Paolo Bettini (Quick Step) pulled out of the Tour of Spain Thursday to begin focusing on his bid to successfully defend his coveted rainbow jersey. Bettini won a stage victory on the Vuelta and came runner-up on several occasions, and did not start the 18th stage. His Belgian teammate Tom Boonen has pulled out of the world road race championships due to injuries on his knee and back, the Belgian cycling federation said Thursday.
Quick Step's 2005 world champion has thus been forced to bring the curtain down on what has been a mitigated season by his high standards.
Boonen, who counts the prestigious Paris-Roubaix and Tour of Flanders one-day classics among his many victories, crashed last week during a stage on the Tour of Spain and abandoned the race complaining of back and knee pain.
A fitness test on Thursday confirmed Boonen's worst fears, and while his back is no longer a problem, he still has persistent pain in his knee.
The world championships will be held in Stuttgart, Germany on September 26-30, with the men's road race crown being disputed on the final day of competition.