Primoz Roglic placed himself in pole position to retain his Vuelta a Espana title with a sensational time trial display as Briton Hugh Carthy impressed to stay in contention.
Carthy ate away at the 32-second gap to Carapaz during the 33.7km stage.
He stays third overall but is now only eight seconds behind the Ecuadorian.
Five stages remain, with the riders now set for a hilly stage 14 covering 204.7km between the Galician city of Lugo and Ourense, which the Vuelta last visited in 1960.
Slovenian Roglic will be a strong favourite for the title although he was philosophical about his chances.
Stage 13 result:
1. Primoz Roglic (Slo/Jumbo-Visma) 46mins 39secs
2. Will Barta (US/CCC Team) +1sec
3. Nelson Oliveira (Por/Movistar) +10secs
4. Hugh Carthy (GB/EF Pro Cycling) +25secs
5. Bruno Armirail (FRA/Groupama-FDJ) +41secs
6. Mattia Cattaneo (Ita/Deceuninck-Quick-Step) +46secs
7 Richard Carapaz (Ecu/Ineos Grenadiers) +49secs
8. Remi Cavagna (Fra/Deceuninck-Quick-Step +58secs
9. David De La Cruz (Spa/UAE) +59secs
10. Jasha Sutterlin (Ger/Team Sunweb) +1min 7secs.