Team Sky’s Geraint Thomas lost the race leader’s jersey on stage four of Tirreno-Adriatico after suffering a mechanical problem in the closing stages.
Thomas and team-mate Chris Froome, who started the day in third place, lost over 40 seconds to stage winner Mikel Landa, while BMC Racing’s Damiano Caruso took over the blue jersey.
Landa, who helped Froome to his last two Tour de France wins before leaving Team Sky for Movistar, claimed victory after a thrilling finish to the 219km stage to Sarnano Sassotetto.
The Spaniard’s victory moved him up to fourth in the general classification standings, 20 seconds off Caruso and six ahead of Thomas, who slipped to fifth.
Caruso leads by one second from Team Sky’s Michal Kwiatkowski, with Wilco Kelderman (Team Sunweb) 10 seconds further back.
After the break was caught in the last 8km, Miguel Angel Lopez (Astana) attacked with just over 5km left, with Rafal Majka (Bora), Fabio Aru (UAE Team Emirates) and Ben Hermans (Israel Cycling Academy) bridging across to the Colombian from the Team Sky-led peloton.
Majka then attacked from the four-man group with 3.5km to go, while Landa made his move from the peloton.
Froome slipped out the back of the peloton, while Landa passed Lopez and joined Aru, Hermans and Majka with 2km left.
But behind them, Thomas suffered a mechanical with just over a kilometre remaining and lost ground on Landa, with Froome losing even more time after trying to help Thomas recover.
Landa prevailed ahead of Majka and George Bennett (Lotto NL-Jumbo), whose late surge moved him up to sixth in the GC standings.