The Ferraris of Sebastian Vettel and Kimi Raikkonen will begin the race at the Circuit de Catalunya in third and fourth place respectively.
It was Hamilton's second pole after the opening race of the season in Australia and his feat broke Sebastian Vettel's streak of three consecutive poles.
"I needed this pole - I've not had one for a while," said Hamilton who leads Vettel in the drivers' title race by four points after four races.
"And it's a Mercedes one-two which is great here. There is always a great atmosphere here with loads of British fans and even Spanish fans supporting us, which is great too."
Hamilton, 33, celebrated pole by taking a 'selfie' in the paddock with the Mercedes support staff. "The team has been working so hard," he added. "So a huge thank you to everyone working hard back at the factory. We really tried to continue to understand and be open-minded.
"It is easy for us to get stuck in our ways and we definitely let loose and became open-minded to try to improve which is great. That is what it takes to be a winning team. It is a constant learning process.”