Spain's Alberto Contador, racing his first Grand Tour since returning from a two-year doping ban last month, won his second Tour of Spain crown on Monday (AEST).

The Saxo-Bank rider, also a two-time Tour de France winner who lost his 2010 Tour and 2011 Giro titles after testing positive for clenbuterol in 2010, safely negotiated the 21st and final 115 kilometre largely flat stage from Cercedilla to Madrid to claim victory.

"This is the culmination of many months of work and sacrifices and not sparing any effort," Contador said.

"People sometimes think it is easy but it is not. I dedicate this victory to those who stuck by me in the good and bad moments. It is because of them that I sacrificed myself.

"You feel like laughing, crying, it is a series of emotions that you can't express with words. It is incredible.

"It has been hard from the beginning, but the more things cost you the better they taste.

"Given the background that I arrived here with, this victory is very special for me. I had not competed for a long time and things were complicated."

Germany's John Degenkolb of the Argos-Shimano team won the final stage in 2 hours, 44 minutes and 57 seconds, Contador coming through buried in the main lead peloton in 54th spot.

The 29-year-old Contador clocked 84 hours, 59 minutes and 49 seconds for the race that covered a total distance of 3,300 kilometres, Alejandro Valverde (Movistar) and Joaquim Rodriguez (Katusha) completing an all-Spanish podium.

Valverde was 1:16 off Contador's pace, with long-time leader Rodriguez a further 21 seconds adrift.

"I am super happy, in the end we won points. It was a good Vuelta for the team, I want to thank them for fighting for me," Valverde said.

"Purito" Rodriguez vowed to carry on battling after the disappointment of losing out to his Spanish compatriots.

"We did everything we could," Rodriguez said.

"Sometimes things do not turn out like one wants, but I am not going to stop fighting and trying to win a major tour.

"Where and when I don't know, but I will try again."

Contador had only words of praise for Rodriguez, saying: "Purito was very strong, he endured the climbs very well.

"It was very hard to win this race but I enjoyed it very much because it was a spectacular Vuelta."

Contador had taken control of the Vuelta on Wednesday's Fuente De stage 17, producing a long-distance attack a day after having failed to shake off Rodriguez on the climb of the Cuitu Negru on stage 16.

His precious lead of 1:35 came under attack on the penultimate day in the gruelling climb of the Bola del Mundo, with both Rodriguez and Valverde attacking the Pinto-born Contador.

But the champion showed all his experience to hold his nerve for a remarkable victory, the Spanish heavyweight trio having called a truce as the sprinters battled for the final stage win.

A breakaway of six riders were hauled back with one lap of the final 5.7 kilometre circuit left, and the Argos-Shimano team managed to get Degenkolb into position for his record-breaking five stage wins on the Vuelta.