Tarragona - Belgian rider Philippe Gilbert has edged out Edvald Boasson Hagen 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 claiming his third podium finish of the race in third.
In the overall classification, Italian Vincenzo Nibali retained the leader's jersey but lost two seconds on Nicholas Roche.
The Irishman picked up two bonus seconds in the sprint past Port Aventura to close to within 31 seconds with Alejandro Valverde and Chris Horner remaining 46 seconds back.
Victory was Gilbert's first since winning the world road race title last year and he thanked his teammates and family for sticking by him during a difficult season.
"Firstly, I want to thank my family and all the people who have believed in me during what hasn't been the best year," he said.
"This victory is very special for me because I have always done well in Catalonia and some of my family live here.
"It was a very fast stage and in the last few kilometres I stayed at the front because I knew the finish and I knew I couldn't take risks for when the sprint started. I am very happy."
On the last stage favourable to the sprinters before a series of demanding climbs over the next week, the early pace was made by Fabricio Ferrari, Romain Zingle and Cedric Pineau.
The breakaway group of three were eventually caught with around 18km to go allowing Roche to get up to claim second in the sprint past Port Aventura behind Ivan Basso.
But despite narrowing the gap on Nibali, Roche insisted the Giro d'Italia winner is still the strong favourite for the overall victory in Madrid come Sunday week.
"Nibali has to be the favourite. He is in extraordinary condition, he is fresh and he'll make things very difficult for us come the mountain stages."
The peloton then stayed together for a bunch sprint in the final kilometre and Boasson Hagen seemed to have it all in his favour as Uran pulled off the front with 500 metres remaining to give the Norwegian a clear run at the line.
However, Gilbert timed his surge to the finish to perfection as he came past Boasson Hagen with ease to claim a fifth career stage victory in the Tour of Spain.
Results of the 12th stage of the Tour of Spain, a 164.2km ride from Maella to Tarragona on Thursday:
1. Philippe Gilbert (BEL/BMC) 4hr 03min 44sec
2. Edvald Boasson Hagen (NOR/SKY) at 0:00.
3. Maximiliano Richeze (ARG/LAM) 0:00.
4. Luca Paolini (ITA/KAT) 0:00.
5. Gianni Meersman (BEL/OPQ) 0:00.
6. Francesco Lasca (ITA/CJR) 0:00.
7. Steve Chainel (FRA/ALM) 0:00.
8. Reinardt Janse Van Rensburg (RSA/ARG) 0:00.
9. Anthony Roux (FRA/FDJ) 0:00.
10. Zakkari Dempster (AUS/APP) 0:00.
11. Adrien Petit (FRA/COF) 0:00.
12. Mitch Docker (AUS/ORI) 0:00.
13. Robert Wagner (GER/BKN) 0:00.
14. Tosh Van der Sande (BEL/LTB) 0:00.
15. Daniele Ratto (ITA/CAN) 0:00.
16. Tyler Farrar (USA/GRM) 0:00.
17. Dominik Nerz (GER/BMC) 0:00.
18. Daniel Schorn (AUT/APP) 0:00.
19. Rigoberto Uran (COL/SKY) 0:00.
20. Lloyd Mondory (FRA/ALM) 0:00.
34. Nicolas Roche (IRL/SAX) 0:00.
35. Vincenzo Nibali (ITA/AST) 0:00.
1. Vincenzo Nibali (ITA/AST) 45hr 26min 06sec
2. Nicolas Roche (IRL/SAX) at 0:31s
3. Alejandro Valverde (ESP/MOV) 0:46.
4. Chris Horner (USA/RSH) 0:46.
5. Joaquin Rodriguez (ESP/KAT) 2:33.
6. Domenico Pozzovivo (ITA/ALM) 2:44.
7. Ivan Basso (ITA/CAN) 2:52.
8. Thibaut Pinot (FRA/FDJ) 3:35.
9. Rafal Majka (POL/SAX) 3:46.
10. Daniel Moreno (ESP/KAT) 3:56.
11. Leopold Knig (CZE/APP) 4:08.
12. Tanel Kangert (EST/AST) 5:05.
13. Rigoberto Uran (COL/SKY) 5:46.
14. Samuel Sanchez (ESP/EUS) 6:38.
15. Eros Capecchi (ITA/MOV) 6:51.
16. Dominik Nerz (GER/BMC) 8:02.
17. Laurens ten Dam (NED/BKN) 8:34.
18. Jos Mendes (POR/APP) 8:56.
19. Jos Herrada (ESP/MOV) 9:07.
20. Janez Brajkovic (SLO/AST) 9:14.