Rome -Spain's Joaquim Rodriguez won the fifth stage of the Tirreno-Adriatico over 230km from Ortona to Chieti on Sunday as Britain's Chris Froome moved into the overall lead.
Sky's Froome finished in a group, including former Tour de France winner Alberto Contador, just a few seconds behind Rodriguez.
That was enough for the Briton to wrench the leader's blue jersey from Michal Kwiatowski's grasp as the Pole was distanced on the final climb.
Rodriguez attacked on the steepest part of the final climb with 1.4km left and put eight seconds into the chasing pack, led home by Dutchman Bauke Mollema with Contador in third.
Froome finished sixth on the same time as Contador and now leads the Spaniard by 20sec with two stages left, including a final stage time-trial.
Italian Vincenzo Nibali came home in seventh, 17sec behind the winner and is now third overall on the same time as Contador.
Kwiatowski drops to fourth after finishing 40sec down on the stage, while Rodriguez has moved up to seventh in the standings, although with 55sec to make up his chances of final victory look slim.
Both Contador and Froome, whose Sky team marshalled the pace with great expertise, tried their luck on that final climb before Rodriguez made an attack stick.
Results from the 5th stage of Tirreno-Adriatico, a 230km ride from Ortona to Chieti on Sunday:Stage
1. Joaquin Rodriguez (ESP/KAT) 6hr 6min 43sec, 2. Bauke Mollema (NED/BLA) at 8sec, 3. Alberto Contador (ESP/SAX) same time, 4. Mauro Santambrogio (ITA/FAR) s.t., 5. Chris Horner (USA/RSH) s.t., 6. Chris Froome (GBR/SKY) s.t., 7. Vincenzo Nibali (ITA/AST) 17, 8. Przemyslaw Niemiec (POL/LAM) 22, 9. Roman Kreuziger (CZE/SAX) s.t., 10. Daniel Martin (EIR/GRM) 28
1. Chris Froome (GBR/SKY) 22hr 11min 53sec, 2. Alberto Contador (ESP/SAX) 20, 3. Vincenzo Nibali (ITA/AST) s.t., 4. Michal Kwiatkowski (POL/OPQ) 24, 5. Chris Horner (USA/RSH) 37, 6. Mauro Santambrogio (ITA/FAR) 52, 7. Joaquin Rodriguez (ESP/KAT) 55, 8. Rigoberto Uran (COL/SKY) 57, 9. Roman Kreuziger (CZE/SAX) 1:27, 10. Sergio Henao (COL/SKY) 1:51