Belgian rider Philippe Gilbert (BMC) edged out Edvald Boasson Hagen (Sky) in a sprint finish to take the 12th stage of the Tour of Spain on Thursday.
Boasson Hagen looked set for victory in the 164.2km ride from Maella to Tarragona after being led to within sight of the line by teammate Rigoberto Uran.
But Gilbert produced a late surge to take victory on the line with Maximiliano Ariel Richeze (Lampre) claiming his third podium finish of the race in third.
In the overall classification Italian Vincenzo Nibali (Astana) retained the leader's jersey but lost two seconds on Nicholas Roche (Saxo).
The Irishman picked up two bonus seconds in the sprint past Port Aventura to close to within 31 seconds with Alejandro Valverde (Movistar) and Chris Horner (RadioShack) remaining 46 seconds back.