Chris Froome has put himself in pole position to make cycling history on Saturday after a brief and brutal stage to the summit of Spain’s toughest mountain climb, the Alto de l’Angliru. His third place set up a probable overall victory in the Vuelta a España the day before the final, largely ceremonial stage through Madrid.

“It feels fitting, romantic in a way as here is where I first had the opportunity to go for my own ambitions in a grand tour,” said Froome. “It’s amazing to come back again, for this to be the ultimate test of this Vuelta. Today is very emotional, coming after the Tour de France this is an even greater challenge.”

“There is a good reason no one has gone from the Tour to win the Vuelta in the same year” – when Bernard Hinault, the last man to win the Vuelta and the Tour in the same year, did the double in 1978, the Vuelta was in late April and early May – “and that is because it is a huge undertaking.” Froome is now contemplating going on to the world time trial championship in Bergen on 20 September – he will decide in the next few days depending on how he recovers from one of the hardest Vueltas in recent years.

The Angliru summit, perilously perched on a rocky slope in Asturias, was the final obstacle in his quest for a historic double, but Spain had eyes and tears for one man, Alberto Contador, who rose to the occasion to take the final mountain stage in the final grand tour of his career.

“We did our best to catch Alberto but he was too strong,” said Froome. “Today was an extremely fitting way for him to say goodbye. To attack on that descent and keep the lead to the finish, chapeau. He brings so much to the races. It’s going to be easier for me when he’s not around but I have to respect what he did today.”

Froome left it late on the climb. Roughly three kilometres from the finish, as his group tackled the slopes of a section of this climb known as the Cuenta de las Cabras – the cradle of the goats – he sensed that his closest rival for the overall title, the Italian Vincenzo Nibali, who had started the day only 1min 37sec behind, was not climbing with his usual fluency, and he accelerated. He was rapidly joined by Poels and together they forged ahead as Nibali struggled on the unforgiving ramp.

Nibali, winner of the Vuelta in 2010, had skidded off the road on the descent from the penultimate climb, the Alto de Cordal, with Froome just behind him when he fell. The Italian went under a crash barrier and was left with grazes and bruised ribs; he regained the peloton but was poorly positioned at the foot of the 12.5 kilometre ascent to the finish, with its tight corners and lengthy stretches at 25 per cent gradient. At the key moment when he needed to put Froome under pressure, he had no response.

The descent from the Cordal, the climb that precedes the Angliru, played a critical role. It is legendary, but not in a good way, with its tight camber-less curves and greasy patches under the trees; it almost did for the Spaniard who led over the penultimate pass, Marc Soler, who slid wildly on a right hander, while David de la Cruz also fell victim.

Knowing its perils, and knowing he had nothing to lose, Contador decided to make his attack, and by the foot of the descent, with Froome riding cautiously in order to minimise the risk of crashing, the Spaniard was clear with his team-mate Jarlinson Pantano, setting up a tense final climb that will live long in the memories of Spanish fans.

By the time Froome and Poels left Nibali behind, Contador seemed to have victory assured, having ridden through the remains of the early escape that had included the Yates brothers, Adam and Simon. The previous nine kilometres had been an extended adios through a corridor of flag-waving, ecstatic fans estimated at 150,000 in number, who had been making their way painfully up the climb on foot and bike since the morning.

They had waited in low cloud, looming mist and autumnal showers, with temperatures into single figures, and a near gale threatening to send sponsors’ banners flying; earlier, the peloton had left Corvera de Asturias in pouring rain, muffled up in arm warmers and rain jackets as if racing in April, and the showers tracked them through the lush valleys, torrential, cold rain one minute, dazzling sunshine the next.

The Angliru turned into a shrine to Contador, seen in Spain as the last in a line of charismatic, daring Iberian stage racers going back to Luis Ocaña in the early 1970s and including Pedro Delgado and José Manuel Fuente. There were banners in honour of their hero, and at one point at least he pedalled painfully across the words “Gracias Alberto” painted on the tarmac. It was an evocative end to a career that has included seven Grand Tour wins, as well as a two-year doping ban which never made much impression in his home country.

Froome and Poels threatened to spoil the farewell party due to their need to gain time on Nibali and the other overall contenders, Ilnur Zakarin and Wilco Kelderman. Contador, meanwhile, was struggling to maintain traction on the steep, slippery wet slopes due to his erratic, out-of-the-saddle climbing style, which throws the weight to the front of the bike. Poels has a particular affinity with this climb, having finished second here in 2011, and at times he pulled Froome so hard that he looked likely to leave his leader behind.

The key question was how much time Contador would preserve at the point where the road dips downward towards the finish line; he crested the last ramp with 25sec in hand, which was just enough, although Froome and Poels had closed to 17sec behind by the chequered flag. Their effort enabled the Briton to extend his lead on Nibali to 2min 15sec, with Zakarin overtaking Kelderman for third, and Contador moving into fourth overall. “One hell of a finale,” said Froome, and few would disagree.