The Briton's best time of one minute 53.860 seconds through rain and spray was a hefty 0.595 of a second quicker than Red Bull's Australian Daniel Ricciardo, who joined him on the front row.
"It is so slippery out there, the conditions - trying to find the grip, not making mistakes on your lap and really putting it together," said Hamilton, who will be chasing his third win in a row on Sunday.
"It was a tough session. I really enjoyed it. The car was feeling great. I hope that we can follow through tomorrow."
It was Hamilton's third pole in four races this season and 34th of his F1 career, pushing the 29-year-old past the late Jim Clark's British record that he equalled in Malaysia last month.
He is now fourth on the all-time pole list led by Michael Schumacher with 68.
Red Bull's quadruple Formula One world champion Sebastian Vettel was third fastest, but more than a second slower than Hamilton and outqualified by team mate Ricciardo for the third time in four races.
Championship leader Nico Rosberg, who had been on pole in the previous Bahrain Grand Prix, completed the second row for Mercedes after running wide on his second lap and then spinning on his final flying lap.
The German will have his work cut out on Sunday if he is to win at the scene of his maiden grand prix triumph in 2012.
"I was just struggling on the brakes and that's why my last sector was so bad. The braking was really difficult and that's a pity," said Rosberg.
"It was just trying a little bit too hard but in the end I was slower anyway on that last lap. I just had to give it a go on the last corner and see if I could somehow magically pull back a little bit of time and it didn't quite work out.
"It didn't really change much. In the end I just wasn't quick enough in general."
Ricciardo, whose team lost their appeal earlier in the week against his exclusion from second place in Australia, bounced back in Red Bull's best combined qualifying effort of a difficult season so far.
The Australian, impressive since joining from Toro Rosso at the end of last year, found a chunk of time late in the final part of qualifying after having trailed the German during the first two sessions.
"Alrighty, there wasn't anything left in that," the 24-year-old said to his team over the radio on his lap into the pits.
Ferrari's Fernando Alonso, last year's winner in China, qualified fifth with new team boss Marco Mattiacci looking on from the pit wall after watching Friday's sessions from the garage.
"Some of the steps that we brought here seem to confirm a positive result so we move a little bit in the right direction. We know that it's not enough but it's the first step," said Alonso.
"We know that Mercedes probably is out of reach in dry conditions but hopefully with Red Bull we are not too far. I don't know if we can be faster than them or not but hopefully not 30 seconds behind them any more."
However, it was a day of mixed fortunes for the sport's glamour team with Kimi Raikkonen failing to make it through to the top 10 shootout after struggling for grip all session long.
Former Ferrari driver Felipe Massa qualified sixth for Williams, who had Valtteri Bottas seventh with both hoping to move up in the race.
Force India's Nico Hulkenberg lines up eighth, with Frenchman Jean-Eric Vergne ninth in the Toro Rosso ahead of compatriot Romain Grosjean, who gave Lotus their best qualifying result so far this season in 10th.
Grosjean's Venezuelan team mate Pastor Maldonado did not take part in qualifying due to problems related to the Renault power unit. He had been due to take a five place grid penalty anyway for causing a collision in Bahrain.
Neither McLaren driver made it through to the final phase of qualifying, with Jenson Button 12th and Danish rookie Kevin Magnussen 15th.
"I didn't know what to expect really. It's been a strange year in terms of the car in the wet. Normally we're very good in the wet but now we're struggling for grip out there," commented Button.
"It's tough in these conditions. I really do hope it's dry tomorrow."
- Motor Racing
- Sports & Recreation
- Daniel Ricciardo