Roglic poised to win fourth Vuelta as Dunbar wins mountainous stage 20
Dunbar, who also won stage 11, took off in pursuit of the leader Pavel Sivakov with five kilometres to the finish on the final climb of this year's Vuelta to Picon Blanco and went on to hold off the chasing group after overtaking the Frenchman.
Spain's Enric Mas came in second with Roglic, who took control of the red jersey after winning Friday's stage, close behind, and the Slovenian now has an overall lead of two minutes and two seconds over Australia's Ben O'Connor.
The 172-km ride from Villarcayo contained seven categorised climbs to test the riders on the penultimate stage, and it was the Irishman who proved strongest, while Roglic (Red Bull-Bora-Hansgrohe) did all that was needed to strengthen his grip on the red jersey.
Dunbar, who has struggled with crashes and injuries in recent times, made his break from a small group of riders containing the top five in the general classification.
"I knew this climb from a few years ago and knew there were steep bits and parts where it levelled out, and that it was a bit different to what was shown on the profile," Dunbar said.
"I rode the steep parts pretty hard and rode the flat bits pretty conservative to make sure I had enough left in the tank."
Roglic, who won three consecutive Vueltas from 2019, came into this year's race as a clear favourite, with the likes of Tadej Pogacar, Jonas Vingegaard and Remco Evenepoel all opting not to ride in Spain, but he had risked losing out to O'Connor.
O'Connor (Decathlon-AG2R La Mondiale) took the red jersey from Roglic after winning stage six, opening up a gap of almost five minutes, but the Slovenian slowly chipped away at the lead and seized control in style when winning stage 19.
"Definitely one day closer than yesterday, so the right direction, but tomorrow is a GC day so we have to finish it off," Roglic said.
Sunday's final stage is a 24.6-km individual time trial in Madrid, where Roglic is set to be crowned champion for the fourth time.