Slovenian Primoz Roglic was crowned king of the Vuelta a Espana for the second successive year as the Jumbo Visma rider safely reached Madrid after a largely processional stage 18, while Ireland's Dan Martin (Israel Start-up Nation) finished an impressive fourth on the general classification.

Pascal Ackermann (Bora–Hansgrohe) beat another Irishman, Sam Bennett (Deceuninck-Quick Step), in a photo-finish to crown a hectic few months of Grand Tours, but it was Roglic who has dominated the race from day one.

It 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 Roglic might let another Grand Tour slip through his fingers as Ecuadorian Richard Carapaz, who battled Roglic hard over the Spanish mountains, dropped him 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.

Former Giro d'Italia winner Carapaz did wear the red jersey for five days but once Roglic took it back with a commanding time trial on Tuesday he was never going to let it go, even if he suffered a huge scare on Saturday.

"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," Roglic said.

"It's amazing and I'm very happy to be part of this team."

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).

The Briton, who will join Israel Start-Up Nation, was presented with the 2011 Vuelta trophy retrospectively before Sunday's final stage after Juan Jose Cobo was stripped of the title.