Barcelona: Lewis Hamilton took pole position at the Spanish Grand Prix for the second year in a row on Saturday with Ferrari's championship leader Sebastian Vettel alongside the Mercedes driver on the front row.
The pole was the 64th of the Briton's career, one short of his late Brazilian boyhood idol Ayrton Senna on the all-time list.
"I'm super proud that we can get back up there. My last lap was so-so but I could see the fans cheering and all the flags," said the triple champion, interviewed on the finish line in front of the crowd in a new departure for the sport.
Hamilton's teammate Valtteri Bottas, a first-time winner in Russia two weeks ago, qualified third, with Ferrari's Kimi Raikkonen fourth.
Dutch teenager Max Verstappen, who became Formula One's youngest winner in Spain last year after Hamilton and then teammate and 2016 champion Nico Rosberg collided at the start, will start Sunday's race in fifth place for Red Bull.
Vettel, who leads Hamilton in the championship by 13 points after four races, had an engine change between final practice and qualifying with mechanics finishing off the job with only minutes to spare.
He then had a big scare during the opening session when it looked momentarily as if his afternoon was already over.
"Stop the car, stop the car now," the German was told over the team radio.
The four times world champion hesitated, however. "Seems better now," he said and carried on. "OK, box, Sebastian, box," he was told.
"OK, you can push," came the eventual radio message from the pit wall as he set the fastest lap of the session before Hamilton and Raikkonen went quicker.
Double world champion Fernando Alonso, whose McLaren broke down in first practice and was slowest overall on Friday, enjoyed a miraculous transformation -- and delighted his home crowd -- by qualifying an astonishing seventh.
Australian Daniel Ricciardo was sixth for Red Bull, with Mexican Sergio Perez eighth in a Force India.
Britain's Jolyon Palmer, yet to score a point this season, had another disappointing Saturday after qualifying 17th in the Renault while teammate Nico Hulkenberg went through to the second phase and will start 13th.
"Yesterday felt good, today I've just struggled," said Palmer.
"It's tough. I really thought this weekend could be good but today it's all come crashing down."
Canadian 18-year-old rookie Lance Stroll, also yet to finish in the points after four races, failed to get his Williams through the first phase and will line up 18th. Brazilian teammate Felipe Massa will start ninth.