SHANGHAI (Reuters) - Mercedes driver Lewis Hamilton stormed to pole position for Sunday’s Chinese Grand Prix after clocking the fastest ever lap of the Shanghai circuit in the dying seconds of a hard-fought qualifying session on Saturday.

Formula One - F1 - Chinese Grand Prix - Shanghai, China - 08/04/17 - Mercedes driver Lewis Hamilton (C) of Britain reacts after setting pole position in qualifying alongside team mate Valtteri Bottas (R) of Finland and Ferrari's Sebastian Vettel of Germany at the Shanghai International Circuit. REUTERS/Aly Song

The triple world champion lapped the 5.4-kilometer long circuit in one minute, 31.678 seconds in his Mercedes, edging Ferrari rival Sebastian Vettel by 0.186 seconds.

Mercedes team mate Valtteri Bottas was third, just one-thousandth of a second further adrift.

“I didn’t know whether we would be ahead or behind,” Hamilton told reporters.

“All I knew I could do is to just do the best lap I could possibly do and each time I went out I eked out a little bit more time.”

Hamilton’s fastest lap in Shanghai bettered Michael Schumacher’s 2004 timing by over half a second.

It also gave Hamilton his 63rd pole and a record sixth in China, making him only the third driver after Schumacher andAyrton Senna to secure six poles at the same grand prix.

The Briton is now five behind Schumacher’s overall record of 68 poles.

It was also the 58th time in 61 races that a Mercedes will start at the front.

Slideshow ( 8 images )

The German outfit were hotly pursued by Ferrari though.

Vettel set a scorching pace to top the final practice session earlier on Saturday. The German and team mate Kimi Raikkonen, who was fourth, also topped the timesheets at the end of the first two parts of qualifying.

Ferrari appeared to be on course to seize pole, with even Mercedes boss Niki Lauda betting against his own team. But in the end Vettel missed out.

“Maybe I ‘chickened’ on to the brakes a bit too soon,” said the 29-year-old Vettel.

“Obviously it was very close with Valtteri, good job we got just enough margin to make it to the front row.”

Red Bull’s Daniel Ricciardo set the fifth-fastest time ahead of Williams driver Felipe Massa.

Nico Hulkenberg went seventh-quickest for Renault ahead of Force India’s Sergio Perez.

Russian Daniil Kvyat in the Toro Rosso was ninth with 18-year-old Williams rookie Lance Stroll rounding out the top 10.

Fernando Alonso, who impressively hustled his McLaren Honda into the second part of qualifying, will start 13th.

Sauber’s Antonio Giovinazzi, who got impressively up to speed on his debut in Australia as a stand-in for Pascal Wehrlein, caused the biggest drama of the day when he ricocheted off the barrier lining the start-finish straight after losing control of his car in the final corner.

Max Verstappen, nursing an engine problem with his Red Bull, was unable to progress past the first part of qualifying after being forced to abort his lap. He ended up 19th on the timesheets.

Sunday’s race will see Vettel going all out to cement Ferrari’s credentials as genuine title contenders with a second successive win, after his triumph in the season-opening race in Australia.

Hamilton, however, is the most successful driver at the Shanghai circuit with four victories to his name.

However, with rain forecast for Sunday, teams could be heading into the unknown, especially after the weather all but wiped out the first two practice sessions on Friday.