Alberto Contador was poised to win the Tour of Spain for the third time after taking the penultimate 20th stage with a late surge.
The Spaniard, who prevailed on the Vuelta in 2008 and 2012, controlled his rivals in the final ascent and struck with just over one kilometre left to counter Britain's Chris Froome.
The Team Sky rider had set the pace in the climb to Puerto de Ancares to defend his second place overall and he was almost empty when Contador attacked, finishing about 16 seconds behind according to provisional results.
Spain's Alejandro Valverde retained third place overall by taking third place at the end of the 185.7-km ride from Santo Estevo de Ribas de Sil.
The top three are unlikely to change after Sunday's final stage, a 9.7-km individual time trial around Santiago de Compostella.
Both Contador and Froome are taking part in the Vuelta after crashing out separately from the Tour de France last July.