Team-mate Nico Rosberg, who is four points clear of Hamilton but has finished runner-up in the last three races, qualified second with Australian Daniel Ricciardo starting third for champions Red Bull.
Hamilton, celebrating his fourth pole of the season and 35th of his career with a time 0.168 seconds quicker than the German, will wrest the overall lead from Rosberg if he wins for the first time at the Circuit de Catalunya.
"I didn't know whether I'd be able to get it but right at the end I just had to eke out absolutely everything and more from the car," said Hamilton, who had been slower than Rosberg in final practice.
"To have the kind of performance we have, I have never really known that before. I'm overwhelmed, I'm so happy," added the 2008 champion, whose dominant team have taken every pole and won all four races so far this year.
Red Bull's quadruple world champion Sebastian Vettel will line up in 10th place on the grid after stopping on track in the final phase of the session.
Vettel has switched to a different chassis for the start of the European season after a difficult opening four races in Asia and the Middle East but his luck has, if anything, taken a turn for the worse.
He managed only four laps in Friday practice before being sidelined by an electrical problem and on Saturday the gremlins returned at the crucial point.
"I left the garage and lost second gear," said the 26-year-old, who has been overshadowed by new team mate Ricciardo.
"It was clear there was a problem but I still had third gear and above so I thought I'd try without second gear. But by Turn One, I'd lost all the other gears."
McLaren, without a point from the last two races, also had problems with Danish rookie Kevin Magnussen unable to set a lap time in the second phase due to a power unit problem and qualifying 15th.
Team mate Jenson Button will start eighth.
Qualifying was twice red flagged, the second stoppage triggered by Vettel's failure and the first coming right at the start when Venezuelan Pastor Maldonado speared his Lotus into the wall.
Maldonado will be at the back of the grid, along with Toro Rosso's Jean-Eric Vergne who has a 10 place penalty after an unsafe release from the pits on Friday.
SPANISH GP - QUALIFYING RESULTS
1-Lewis Hamilton (Mercedes) - 1:25.232
2-Nico Rosberg (Mercedes) - 1:25.400
3-Daniel Ricciardo (Red Bull) - 1:26.285
4-Valtteri Bottas (Williams) - 1:26.632
5-Romain Grosjean (Lotus) - 1:26.960
6-Kimi Raikkonen (Ferrari) - 1:27.104
7-Ferbando Alonso (Ferrari) - 1:27.140
8-Jenson Button (McLaren) - 1:27.355
9-Felipe Massa (Williams) - 1:27.402
10-Sebastian Vettel - No time set in Q3
- Motor Racing
- Sports & Recreation
- Nico Rosberg
- Daniel Ricciardo
- Red Bull
- Sebastian Vettel