The Jumbo Visma rider safely reached Madrid after a largely processional stage 18 of the competition.
Carapaz (Ineos Grenadriers) finished second while Britain’s Hugh Carthy (EF Pro Cycling) made the podium of a Grand Tour for the first time in his career.
It was an emotional day for Chris Froome, the four-time Tour de France champion, as he rode his last day in the saddle for Ineos Grenadiers (formerly Team Sky).
Roglic’s triumph was a sweet moment for the 31-year-old former ski jumper, whose hopes of winning this year’s Tour de France were snatched away in dramatic circumstances on the penultimate day.
For a while, on the final brutal climb to Alto de la Covatilla on Saturday, it had looked as though Slovenian Roglic might let another Grand Tour slip through his fingers.
Ecuadorian Richard Carapaz, who battled Roglic hard over the Spanish mountains, dropped Roglic in a devastating late attack.
But Roglic dug deep and although his 45-second lead was slashed in half, he entered the final day’s flat 139km roll-in to Madrid with a 24-second lead and the red jersey secured barring an unprecedented mishap.
The final day of the 75th edition of the Vuelta was left for the sprinters to strut their stuff along Madrid’s eerily quiet Paseo del Prado – a consequence of the Covid-19 pandemic which has largely locked down the city.
Following his victory, Roglic said: “The more you win the more you learn how to enjoy it but it’s always a different story, it’s a different race and you can’t compare it.
“It’s amazing and I’m very happy to be part of this team.”
Additional reporting by Reuters.