Pogačar was the fastest in the final kick to the line on the formidable climb of Los Machucos, after race leader Roglič had opened up the gap on his rivals for the red jersey with a series of attacks on the double-digit gradients of the final climb.
Pogačar was the lone rider able to stick with his Slovenian compatriot and proved strong enough in the finish to come over the top and outsprint Roglič to claim his second victory of this year's Vuelta a Espana.
“At the start I didn’t know I would feel so good on the last climb," said Pogačar."In fact, I just wanted to survive because after stage 7, my goal was simply to not lose too much time. But in the end it was an incredible day for me.
"When I heard over the radio that nobody was following me and Roglič, I realised that it was a good opportunity to go for the stage. And with Roglič it’s always difficult to go against him because he’s really strong. I could do that today and I’m really, really happy.”
Stage 13 contained seven categorised ascents, with Astana leading the way for Miguel Angel Lopez to soften up the race before he could launch an assault on the brutal slopes of the final climb.
The peloton tackled the Alto de la Escrita (5.9 kilometres at 4 per cent), Alto de Ubal (7.9 kilometres at 6 per cent), Collado del Asón (13 kilometres at 3.9 per cent), Puerto de Alisas (8.5 kilometres at 6 per cent), Puerto de Fuente las Varas (6.3 kilometres at 4.5 per cent) and Puerto de la Cruz de Usaño (4.2 kilometres at 4.7 per cent).
Each were tough climbs in their own right but just proved to be the setting for the final climb of Los Machcucos (6.8 kilometres at 9.2 per cent).
Nairo Quintana (Movistar) was the first of the big-name riders to attack on the early slopes of the final climb, though he was brought back at a similar stage as the majority of the break were swept up by the peloton.
Roglič asserted himself in the final three kilometres as the road sloped upwards sharply to gradients approaching ridiculous pinches of up to 25 per cent.
While Pogačar is now fully in the podium fight as he moved into third position overall, he laughed when he was asked about his chances at winning the race.
"I don't think so," Pogačar said when asked. "I think Primož is holding on to the red jersey really good."
The Slovenian pair have been allies of convenience to this current point of this year's race, perhaps actual friends as well, highlighted by their fist bump as they crossed the finish line on Stage 12.