Lewis Hamilton has snatched pole position for the Malaysian grand prix by the narrowest of margins.
His title rival Sebastian Vettel will start last on the grid after suffering an engine problem.
Vettel needed an engine change to his Ferrari after the last practice at Sepang on Saturday and immediately suffered a problem which could not be fixed in the first qualifying session.
Hamilton, whose Mercedes struggled with balance in practice, set the pace with a lap of 1min 30.076sec for the 70th pole of his career.
He edged Ferrari’s Kimi Raikkonen by 0.045sec.
“We had no idea what was going to happen today. I’m sorry for what happened to Sebastian and it is a real surprise to be up here with these guys,” Hamilton said.
The Red Bulls of Max Verstappen and Australian Daniel Ricciardo were next, followed by Valtteri Bottas in a Mercedes and Esteban Ocon in a Force India.
Three-time world champion Hamilton goes into Sunday’s race with a 28-point lead over Vettel, who was out of the points two weeks ago after crashing shortly following the start of the Singapore Grand Prix.
It was Hamilton’s fourth successive pole in Sepang and his fifth in the past six races on the circuit, where his only win came in 2014.
Vettel’s Ferrari had limped into the pits in the first qualifying session. He had already needed an engine change after a problem experienced in the day’s earlier last practice.
The Ferrari engineers were unable to repair the problem before the session ended, meaning Vettel will be last on the grid in Sunday’s race.
“It was a bad day but the race is tomorrow,” Vettel told Sky Sports.
“We need to see now what the problem is but we managed to do the change in time. It was a miracle and the guys were amazing.
“It was a shame that I couldn’t get it out.”
Stoffel Vandoorne in a McLaren, Nico Huelkenberg in a Renault, Sergio Perez in a Force India, and Fernando Alonso in a Mercedes completed the top 10.