That Lewis Hamilton will clinch his fifth world championship in Mexico City on Sunday remains almost a certainty. Doing so with the celebratory flourish of victory however will require the British driver to be on absolutely top form after Red Bull’s Daniel Ricciardo claimed pole position, locking out the front row with his teammate Max Verstappen.

If it is a race contested with the same fierce competition that defined a thrilling qualifying, it should at least prove to be a memorable meeting at which the British driver wraps up the title.

Hamilton, despite some exceptional performances over the single lap this season, could manage only third on a track where the Mercedes has not been at its best. Crucially, however, his title rival Sebastian Vettel, who must win to keep his title hopes alive, was behind him in fourth.

Hamilton requires a seventh place or better finish at the Autódromo Hermanos Rodríguez to equal Juan Manuel Fangio’s five championships. He is under no pressure to force a win and will be able to manage his race accordingly. He has repeatedly played the percentages well this season and there is no reason he should not do so again to ensure the title.

His biggest concern will be staying clear of trouble from the off – he was sent to the back of the field with a puncture when he clashed with Vettel’s Ferrari on the opening lap last year. Hamilton insisted he would not alter his approach from the start line, however. “If you go easy, you can get hit. If you go too aggressive, you can hit or still get hit,” he said. “You’ve got to race it like normal and go in for the win. That’s what I’m going to be doing. I mean, that’s what we’re here to do – to race.”

The Red Bull’s form in long runs in practice suggests they will carry strong pace into the race and that they have every opportunity to take the win. The team principal, Christian Horner, confirmed his drivers would be allowed to race and, with this the best chance either has of a final win this season, their fight is likely to be uncompromising.

Ricciardo was ecstatic at taking pole, having upset a narrative that had seemed almost inevitable. With Verstappen quickest in every practice session and on his first run in Q3, the Dutchman looked all set to claim the record for youngest ever pole-sitter. Ricciardo, however, refused to lie down and took pole with a superb lap on his second run in Q3 with a track record time of 1min 14.759sec. He had to be at his best to beat Verstappen, who was just two hundredths down. The Dutchman was visibly disappointed and complained his car had struggled with rear-locking during the session.

Yet Ricciardo, whose two previous poles had both been at Monaco, had executed what was his lap of his season. He was marginally tighter into the hairpin in the stadium during the run, enough to make a difference when there had been almost nothing to choose between the two teammates.

Ricciardo gave a guttural roar of celebration on taking the place. “I let a bit out once I heard I got pole,” he said. “It’s been a while since pole. It’s been a while since we had a pretty good weekend in general and we’ve been quick all weekend, from the start. And from the team’s point of view to get a one-two in qualifying is awesome.”

It is a hugely positive result for the Australian, who is going to Renault next year, as he has been strongly out-qualified by Verstappen this season. For Red Bull it was a vindication of their optimism in Mexico. The thinner air at altitude here negates their power deficit and the high downforce setup plays to the strengths of their car. They were able to make the most of it when it mattered and are well set to take the win. Hamilton might have other ideas but with a championship on the line may well opt to let the two duel it out between themselves and secure greater glory.

Valtteri Bottas was in fifth with Kimi Räikkönen in sixth. Nico Hülkenberg and Carlos Sainz were strong for Renault, finishing in seventh and eighth, with the Saubers of Charles Leclerc and Marcus Ericsson in ninth and tenth.

Fernando Alonso in the McLaren was 12th and went out in Q2 behind the Force India of Esteban Ocon. The second Force India of Sergio Pérez was in 13th in front of the two Toro Rossos of Brendon Hartley and Pierre Gasly.

Romain Grosjean in the Haas was eliminated in 16th in Q3 with his teammate Kevin Magnussen in 18th. McLaren’s Stoffel Vandoorne was in 17th with the two Williams of Lance Stroll and Sergey Sirotkin once again at the back of the field in 19th and 20th.