Kevin Magnussen converted the encouraging pace Haas has displayed all weekend to qualify best of the rest in seventh, edging out local hero Fernando Alonso, who put McLaren through to Q3 for the first time of the season.
"I needed this pole", said the four-times Formula One world champion, whose performance was watched by Daimler chairman and Mercedes-Benz boss Dieter Zetsche, in the post-qualifying interviews at the Spanish Grand Prix.
First corner prediction: With Mercedes locking out the front row, Hamilton is the favourite tp lead the pack through Turn 1 but keep an eye out for Sebastian Vettel starting from the clean side of the grid behind the lead Mercedes.
"After four races, you develop things", he said.
Vettel said he was "not entirely happy" but already expected Mercedes to be strong. "I didn't think that way but when I got back to the factory and they showed me the race traces, I actually had really good pace through the race".
Raikkonen was a further 0.307 seconds slower than his teammate and ahead of the Red Bull-Renaults of Max Verstappen and Daniel Ricciardo.
"I've not had pole for a while", Hamilton said. It was very close but I'm very happy.
The European leg of the 2018 F1 season kicked off under a clear blue Spanish sky and warms temperatures in Barcelona, with a session where everyone was eager to trial their various upgrades and updates. He and Verstappen were six tenths off the pole time.
"I'm a bit disappointed but it could have been worse". I think the tires this weekend are different because obviously we had the change, it's for everyone, but I think they are a bit harder. After a good showing in Baku, the Williams vehicle appears to have returned to its normal level.
In cooler conditions, the session was brought to an early conclusion when New Zealander Brendon Hartley lost control of his Toro Rosso auto at Turn Nine and spun violently into the barriers.
He was classified 20th and was eliminated along with German Nico Hulkenberg, who suffered fuel problems with his Renault, Swede Marcus Ericsson of Sauber and Russian rookie Sergey Sirotkin and his Williams team-mate Canadian teenager Lance Stroll.
The rear of his vehicle was destroyed by the high-speed impact, both rear wheels and the rear of the gearbox were left hanging by their tethers, but Hartley was unhurt, if severely dazed.