French youngster Warren Barguil (Argos-Shimano) broke clear in the final kilometre of Friday's 169km ride from Valls to Castelldefels to claim the 13th stage of the Tour of Spain.
The 21-year-old was part of a breakaway group of 10 that controlled the second half of the stage but he made the telling break to seize his first professional stage win ahead of Rinaldo Nocentini (Ag2R) and Bauke Mollema (Belkin).
Race leader Vicenzo Nibali (Astana) finished amongst the peloton 2mins 43secs back along with all the other major contenders in the general classification to maintain his 31 second advantage over Nicholas Roche (Saxo).
Barguil celebrated his victory as he crossed the line by pointing to the sky and he dedicated his maiden win to his recently deceased grandfather.
Tomorrow is a different story. I think that Rodriguez could attack and he has proven today that he is in good condition
"I am very happy and especially for my grandfather because he was an inspiration for me."
And victory also completed a huge turnaround in fortunes for Barguil after he suffered a heavy fall in Monday's 10th stage in Granada which saw him lose 25 minutes in the general classification.
"I was very disappointed after my crash because I was 19th in the general classification and I felt I was in very good shape.
"Today though the attack went well and I am delighted to seal this first victory."
After Michele Scarponi (Lampre) had briefly led on his own following the category one climb up the Alto del Rat Penat, the Italian was joined by a group of nine more riders that had broken away from the peloton.
The breakaway group maintained their lead of around three minutes from the peloton for the final 40km of the race.
With the winner certain to come from the leading 10, Jerome Coppel (Cofidis) and Egoi Martinez (Euskaltel-Euskadi) were first to attack but were quickly caught before a tactical period followed with no one wanting to take the lead.
However, eventually it was the inexperienced Barguil who made the decisive attack for the line as he held on comfortably in the 400-metre climb to the finish.
Nibali, Roche, Alejandro Valverde (Movistar), Chris Horner (RadioShack) and Joaquim Rodriguez (Katusha) all registered the same time back in the peloton to ensure there was no change in the top five in the general classification.
However, Nibali is expecting more of a challenge from Rodriguez on Saturday as the race heads into Andorra with a series of daunting climbs in the final 100km.
"Tomorrow is a different story. I think that Rodriguez could attack and he has proven today that he is in good condition.
"There are a lot of kilometres until the end of the race. I know the finish tomorrow a little bit and we'll see what happens."