With qualifying reaching its climax, Lewis Hamilton’s imperious march towards his fifth Formula One title threatened to hit a bump in the road in Texas on Saturday. However, the Mercedes driver is almost unbeatable on this circuit and responded to the unexpectedly stiff challenge of the two Ferraris by setting a track record to claim pole position for Sunday’s US Grand Prix.

Hamilton set the pace but Kimi Räikkönen and Sebastian Vettel soon shoved him down to third place. It looked like the Briton might deliver his worst qualifying performance in Austin since 2013, the only year he has failed to win here, but he roared back in the third qualifying period with a time of 1min 32.237sec.

“Clearly very intense,” Hamilton said. “Today in practice the Ferraris looked like they had made some improvements. Once we got to Q3 it was about not leaving a millisecond on the track, basically.”

Hamilton’s title rival, Vettel, was second, and less than a 10th of a second slower but an intriguing duel at the head of the pack may not materialise since he will start in fifth position as the result of a penalty for breaking a red flag rule on Friday. That is an ominous sign for his prospects of extending the championship battle for at least another week, given that in its six previous years the Austin grand prix has never been won by a driver starting outside the front row.

Still, Vettel was philosophical. “Surprisingly close. I don’t think we expected it to be that close,” he said. “Bit of a shame to just miss out.”

Hamilton is chasing his fifth successive victory – a streak he also achieved en route to winning the 2014 title – and his seventh win in eight races. Among the potential outcomes that would see the 33-year-old champion retain the trophy is victory if Vettel finishes third or lower. Few would bet against the first half of that equation, at least, at a circuit where Hamilton has won five grands prix, including the past four.

After dominating the first two practice sessions in wet conditions on Friday while Vettel struggled, Hamilton was only the third fastest in final practice under foreboding grey clouds. Vettel, meanwhile, clocked the best time, albeit only fractionally better than his teammate, Räikkönen, and Hamilton.

Given that Mercedes have a faster car than Ferrari on wet surfaces, an unexpected improvement in the weather on Saturday was at least a welcome and much-needed piece of good news for Vettel. “The Ferraris are obviously really quick,” Hamilton said.

Forecast earlier in the week to be rainy, race day looked likely to be dry – and sunnier than Vettel’s disposition on Friday. The German was given a three-place grid penalty for failing to slow sufficiently for a red flag during the first practice session while gravel was being cleared from the track.

He railed against the verdict and the rule but it was the latest in a string of unforced Ferrari blunders that have all but handed the title to Hamilton, who, as last year, has grown stronger as the season has gone on. “After the weeks we had I’m pretty pleased we are back in range,” Vettel said.

Hamilton has a 67-point lead with four grands prix remaining, meaning he needs eight more points than Vettel to seal his fifth title. That would draw him level with Juan Manuel Fangio and in sight of Michael Schumacher’s record tally of seven. Vettel, 31, has four championships but none since 2013.

Toto Wolff, the Mercedes team principal, believes Ferrari may have the faster car. Räikkönen, third-fastest in qualifying, starts in second thanks to Vettel’s penalty. The Finn will be on ultra-soft tyres that may give him an advantage at the start, with Hamilton and Vettel on super-softs that provide less grip. “We’re lacking a bit of straight-line speed and it’s going to be very difficult to defend against the Ferraris. That’s my worry,” Wolff said. “I’ve always said you cannot write them off.”

Hamilton, though, is relaxed. In the post-session press conference he initially appeared to describe his best lap as “perfection” before – in true perfectionist style – walking back that assertion. Near-perfect, though, would be fair comment. “I’m so happy,” he said. “It was a different feeling today coming in. I don’t know why. I don’t know if I slept longer or what but I was in a different headspace going into qualifying, which is weird, but it was a good one.”