(Reuters) - Ecuadorean Richard Carapaz launched a solo attack 28km from the end of a mountainous 14th stage to seize the leader's pink jersey from Jan Polanc in the Giro d'Italia on Saturday.
The Movistar rider rode away over the summit of the Colle San Carlo and built his lead to the finish line.
Nibali (Bahrain-Merida) was the first to test the strength of the leading bunch with a series of attacks on the Colle San Carlo but he could make none of them stick.
Carapaz then launched off the front and no one could respond to him as he accelerated down the descent and consolidated on the final category three climb of the day.
His 10-second time bonus for winning the stage stopped Roglic reclaiming the maglia rosa.
"The truth is that we used a strategy that was well planned by the team," he said. "We knew that I and Mikel Landa were in good form so we had to catch the right moment to attack.
"I did everything as planned. It's hard to believe that I'm in the Maglia Rosa. It was a dream, I've worked hard for this."
Simon Yates, who recovered after earlier being dropped, tried to chase down Carapaz, finishing strongly in second, a minute and a half behind with Roglic's group one minute 54 seconds back. Yates moved back into the top 10.
Overnight leader Polanc cracked on the San Carlo and slipped to seventh overall, more than three minutes down.
Sunday's Stage 15 is a 232km ride from Ivrea to Como over the Madonna del Ghisallo and Civiglio climbs.
(Reporting by Martyn Herman, editing by Ed Osmond)