Geraint Thomas will wear the leader's pink jersey into Saturday's decisive mountain time trial at the Giro d'Italia after Primoz Roglic could take only a handful of seconds out of the Welshman's advantage on the Queen stage in the Dolomites.
Thomas and Roglic traded attacks in the final kilometre of this beastly stage but at the very top of the Tre Cime di Lavaredo it was Roglic, who had changed bikes on the approach to the last climb to get better gearing, who was able to open up a three-second gap in the final few metres.
That cuts Thomas' advantage to just 26 seconds going into Saturday's race against the clock to the top of the Monte Lussari.
Joao Almeida was distanced in the last couple of hundred metres to concede 20 seconds but the Portuguese comfortably retains his spot on the podium, 59 seconds down, after Irishman Eddie Dunbar fell away late on to lose fourth place overall to Damiano Caruso.
"It was OK," Thomas said. "When I went with 400 metres to go I realised after 100 that 400 is a long way at this altitude. I just tried to pace it and then Roglic came past in the last 100 metres or so.
"I lost a couple of seconds on the line but it was nice to gain some time on Joao, it will be super close tomorrow. I think it's going to be exciting to watch, horrible to do."
Santiago Buitrago took the win from what had been a 12-strong breakaway, again denying Derek Gee, the Canadian who was in a seventh break of this Giro and who had fought until the final 1500 metres before watching the Colombian dance away.
Before the stage began Thomas, who celebrated his 37th birthday on Thursday, had joked he should not still be doing this sort of thing at his age and ought to be on a beach somewhere.
Instead, the Ineos Grenadiers rider was tackling a 183km stage through the Dolomites that included almost five and a half thousand metres of climbing.
The last time the Giro visited this finish 10 years ago, Vincenzo Nibali emerged from a snowstorm at the summit to take a win which effectively sealed his overall victory.
There would be nothing so decisive here given what is still to come on Saturday, but it could be another major test ticked off for Thomas as Roglic could only put a minor dent in his lead.
The Slovenian certainly tried to do more. With 20km to go Roglic stopped to swap bikes, hopping on to a machine with a single ring on the front and a monster 44t sprocket at the back, a sign of his intentions for a finale where gradients hit 16 per cent.
As clear skies gave way to heavy rain and hail, Thomas's Ineos Grenadiers set their usual strong tempo to whittle down the slim remnants of the peloton.
That did for Dunbar with a couple of kilometres to go. Almeida briefly moved up as riders fought for space on roads packed with excited fans.
Roglic wriggled through but Thomas reacted to stay on his wheel as they reached the sanctuary of the barriers on the approach to the line.
Thomas then made his own move with 400 metres to go and seemed to be leaving Roglic behind, only for the Slovenian to find a final kick at the end and take back three seconds, narrowly failing to catch Magnus Cort who rode in third to take the last of the bonus seconds on the line.