Roberto Heras won the Tour of Spain for a record-equalling third time after resisting a late charge from compatriot Santiago Perez on Sunday.
Phonak rider Perez prevailed in the Madrid stage, a 28.2km individual time trial, in 35 minutes and 5 seconds.
But he took only 13 seconds out of the 2000 and 2003 champion, who finished 30 seconds clear overall to join Swiss Tony Rominger as a three-time winner.
Francisco Mancebo sealed an all-Spanish podium by pipping Alejandro Valverde.
Heras effectively won the race on the 12th stage where his superior climbing skills saw him take the lead.
But Perez was a worthy runner-up after winning three stages - including two time-trials - while Spanish champion Francisco Mancebo finished second in the Sunday time-trial.
Valverde saw his rollercoaster ride end in disappointment.
He had been as little as five seconds adrift of Heras despite a heavy fall which nearly
forced him out.
The best placed non-Spaniard was Stefano Garzelli, of Italy, down in 11th spot.
1. Roberto Heras (Sp) - 77 hours 42 minutes 46 seconds
2. Santiago Perez (Sp) at 30 secs
3. Francisco Mancebo (Sp) at 2:13
4. Alejandro Valverde (Sp) at 3:30
5. Carlos Garcia Quesada (Sp) at 7:44
6. Carlos Sastre (Sp) at 8:11
7. Isidro Nozal (Sp) at 8:32
8. Angel Gomez (Sp) at 13:08
9. Luis Perez (Sp) at 13:24
10. David Blanco (Sp) at 15:15