Lewis Hamilton said Mercedes had to extract “every millisecond” it could as he claimed pole position for the Spanish Grand Prix.
Hamilton led the way in all three segments of qualifying but faced a stern challenge from Ferrari rival Sebastian Vettel, who wound up just 0.051s adrift of the three-time champion.
“That was a really intense qualifying,” said Hamilton.
“We had to pull out every millisecond we could to take pole. We made some changes ahead of qualifying and the car felt great, so I was very happy with it.
“The race pace is looking good and the team has done an incredible job this weekend, as always.
“I don't know if the guys back at the factory get tired of hearing this, but they've done an incredible job.
“To make this step forward and bring a great package for this weekend to keep us in the fight with the Ferrari, I'm so grateful to them.
“We'll work as hard as we can on Sunday so that effort doesn't go to waste.”
Team-mate Valtteri Bottas recovered from an overnight engine change, and a water leak which restricted his FP3 running, to finish third.
“For me starting the day with the engine change and moving back to the old engine, I was always going to be on the back foot,” he said.
“I really struggled through qualifying with the rear stability of the car, so it was difficult to find a good rhythm.
“It wasn't one of my best qualifying sessions but I'm happy with the job that the team has done.”