Carthy pulled clear of Aleksandr Vlasov and Enric Mas in the final kilometre just as the climb began to ease and accelerated towards the finish line to claim his first stage win at a grand tour.
Carthy crossed the line 16 seconds ahead of the Russian and the Spaniard, who came second and third, while Carapaz also finished 16 seconds down in fourth but missed out on bonus seconds by failing to get on the podium.
Carapaz pulled off a series of attacks on Roglic over the final two kilometres and the Slovenian dug deep at first before running out of energy as the gap widened, but he managed to limit the damage once the brutal climb lessened towards the summit
The 109-km stage featured five categorised climbs and culminated up the Alto de l’Angliru, widely regarded as the toughest ascent in pro cycling.
Sunday’s route is the shortest non-time-trial stage of the Vuelta but undoubtedly the most punishing, featuring gradients of up to 24% in the final three kilometres.
The riders will take a well-earned second rest day on Monday, with the action resuming on Tuesday with an individual time trial.