Lewis Hamilton exhibited the touch and confidence that defines a multiple Formula One world champion in Mexico City on Saturday night, amid the maelstrom of a tense championship fight with his Mercedes team-mate Nico Rosberg.

A consummate lap in Q3 topped a dominant session in which Hamilton pushed to the limit of the Autódromo Hermanos Rodríguez and claimed pole for the Mexican Grand Prix, beating Rosberg by two-tenths of a second.

Hamilton had been faster than his team-mate in all three practice sessions and was so again through Q1 and Q2. His first run in the final shootout with a time of 1min 18.704sec confirmed that form and was enough. Rosberg pushed but he was more than five-tenths back on every lap but his last.

Hamilton, however, strung together a sequence of improving runs that came together on his penultimate hot lap, a performance which he acknowledged had been tricky. “It’s always tough trying to pull out perfect laps when it matters,” he said. “Definitely very challenging.”

The Red Bulls of Max Verstappen and Daniel Ricciardo were in third and fourth and the two Ferraris of Kimi Raikkonen and Sebastian Vettel were in sixth and seventh, with an impressive fifth for the Force India of Nico Hulkenberg.

Hamilton’s 10th pole of the season could not have been more timely as his battle with Rosberg reaches the endgame and he is now in a position to narrow the 26-point gap. Rosberg will still take the title should he finish second to a Hamilton win in the remaining three meetings but the world champion needs to force the fight to the wire. It is crucial he has a clean getaway, an issue that has compromised his season as much as mechanical problems.

Should he hold the place on the 800m run, the longest of the season, to turn one, he will be able to dictate the race and crucially have the first call on pit-stop strategy. He will also be in clean air – the best place for the Mercedes – and where he needs to be, since he cannot afford a DNF. His retirement and a Rosberg victory would mean the German claims the title here.

Confident following his win in Austin and having dialled-in the car, he did everything required of him but only the first part of the business of keeping his title hopes alive.

The two Williams of Valtteri Bottas and Felipe Massa were in eighth and ninth with Carlos Sainz Jr putting in a strong run to place his Toro Rosso in tenth.

Rosberg had left it late to secure a front row place and there was, briefly, a real danger that the consistency and determination he has shown all season, during which he has put his car on the front row, before penalties, for every race, was going to come apart. He was five-tenths down on his team-mate in Q1, six-tenths in Q2 and five again on the first hot laps of the final session.

His last run was hooked-up well however and it finally narrowed the gap. For the race though, Hamilton’s control and obvious ease with the circuit is already to his advantage. His time in Q2 was second-fastest only to Verstappen despite having to slow when coming up behind a weaving Vettel on the exit of the Stadium.

Rosberg had needed to push because the competition have found some speed in the thin air of Mexico City and both the Red Bulls and the Ferraris had shown good pace early in the session. Verstappen in particular had another confident run. He has mastered the single-lap discipline well this year, with this second-row slot adding to his third places at Silverstone and Malaysia, fourth at Hungary, Germany, Singapore, the US and Barcelona, the race he went on to win for his debut F1 victory.

Both Mercedes drivers have the advantage of starting on the more durable soft tyres having set their fastest time in Q2 on the harder compound. Hamilton noted that the track had rubbered-in considerably over the weekend and lap times, already well up on last year, are expected to drop further on Sunday, with top speeds going into the braking zone on the entrance to turn one likely to exceed 227mph.

There was disappointment for the local fans when Sergio Pérez could put his Force India only into 12th, splitting the two McLarens of Fernando Alonso and Jenson Button. The Renault of Kevin Magnussen was in 14th ahead of Sauber’s Marcus Ericsson. Pascal Wehrlein had another creditable performance to put his Manor into Q2 and finish in 16th place, well ahead of his team-mate.

Mexico’s second driver, Esteban Gutiérrez, span his Haas on his final quick lap and was knocked out of Q1 in 17th place. Toro Rosso’s Daniil Kvyat was 18th, the Sauber of Felipe Nasr in 19th and the second Manor of Esteban Ocon in 20th. Romain Grosjean in the second Haas had a battery problem and will start from 21st. Britain’s Jolyon Palmer will start his Renault from the pit lane after he cracked his chassis on one of the sausage kerbs in final practice and could not take part in qualifying.