(CNN) -- Ryder Hesjedal became the first Canadian to win a stage in the Vuelta Espana when edging Spain's David Garcia in a sprint at the end of the mountainous 174km 12th stage from Almeria to Alto de Velefique on Friday.
Hesjedal celebrates crossing the line ahead of David Garcia on stage 12 of the Vuelta Espana
Garcia burst away from an 11-man leading group at the start of the third and final climb of the day, but had to settle for second place -- a second behind Hesjedal at the mountain summit.
Dutchman Robert Gesink, of the Rabobank team, was a further five seconds adrift in third spot.
Garmin rider Hesjedal completed the route in five hours, 34 minutes and 31 seconds and told reporters: "It was really difficult. You never know what's going to happen after a rest day. We knew it was going to be a hard day. I just felt great all day."
Pre-race favorite Alejandro Valverde crossed the line in sixth spot to retain the overall leader's golden jersey.
Caisse d'Epargne's Valverde remains just seven seconds ahead of Australian Cadel Evans, who finished just behind Valverde on the day.
Gesink is also third in overall classification, but closed the gap to just 18 seconds on Valverde.
The Vuelta continues on Saturday with another mountain stage -- a 172km trek from Berja to Alto de Sierra Nevada.