Formula 1 world championship leader Lewis Hamilton says he surprised himself with his Malaysian Grand Prix pole lap, as Mercedes turned the corner after a rough start at Sepang.
Hamilton was only sixth in both Friday practice sessions, ending the day 1.4s off the pace set by his title rival Sebastian Vettel.
But while Hamilton's pole bid on Saturday was helped by an engine issue ruling Vettel out of contention in Q1, he still had to prevail in a closely-fought duel with the other Ferrari of Kimi Raikkonen - beating the Finn by just 0.045s.
"We had such a difficult day yesterday, difficult to know where we stood," Hamilton said.
"I didn't sleep very well, just like all my engineers, we didn't know whether we would fix the issue or not.
"Today we arrived and the car was much better, still it looked like the Ferraris were a bit ahead.
"The [pole] lap was very well put together, very nice lap, I don't really know where it came from, I surprised myself.
"So, it's a surprise to be up here, but I am very grateful."
Hamilton had been close on pace with team-mate Valtteri Bottas for much of the weekend, yet beat the other Mercedes man by almost seven tenths in Q3.
Bottas said after qualifying he regretted sticking with Mercedes' new-for-Malaysia aero updates following the team's disastrous Friday showing, while Hamilton reverted to the older specification overnight.
"Before qualifying I thought about going back to new package, times [in FP3] were similar and Valtteri was happy," Hamilton said.
"I didn't want a [performance] penalty, but there wasn't enough time and there was a risk of changing the car again and maybe getting something wrong. That is why we ended up staying on it.
"I was comfortable with it, and it provided a stepping stone in terms of set-up.
"Ultimately we were down on performance, but it didn't make much difference."
Hamilton believes, on evidence of Saturday morning practice, that Mercedes is still lacking long-run pace compared to rivals.
"In FP3, we did a long-ish short run, only five laps. The car was much better position [than on Friday], but we were something like four or five tenths off the other guys.
"We will see tomorrow if that is still the case. We made some changes into qualifying that should suit the car tomorrow so I am hopeful we will be there or thereabouts."