The 25-year-old Carapaz made his move with 3 kilometers to go on the penultimate climb of the Colle San Carlo and held off other overall contenders to claim his second win of this year's race and his third overall.
"The truth is that we used a strategy that was well planned by the team," Carapaz 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 and I've worked hard for this." Simon Yates recovered after being dropped on that climb to finish second, 1 minute, 32 seconds behind Carapaz at the end of the stage which featured five climbs and a second successive uphill finish, to the foot of the Monte Bianco Skyway.
Vincenzo Nibali crossed the line in third place, 1:54 behind, with the same time as a number of other overall favorites, including Primoz Roglic. Carapaz now leads Roglic by seven seconds with Nibali third, 1:47 behind.
Sunday's 15th stage is mainly flat for the first 160 kilometers but has three categorized climbs in the final part of the 232-kilometer route from Ivrea to Como. The three-week race ends in Verona on June 2.
More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports