Hamilton was 1.148 seconds quicker than Red Bull's Max Verstappen in second place as title rival Sebastian Vettel of Ferrari could manage only eighth.
But Vettel will start sixth because of grid penalties for Verstappen and team-mate Daniel Ricciardo, who was third.
Lance Stroll took a stunning fourth.
The Williams driver finished ahead of another notable performer as Frenchman Esteban Ocon took fifth in the Force India.
Hamilton's pole moves him one ahead of Ferrari legend Michael Schumacher and it was a performance worthy of such a momentous achievement.
Conditions were awful - the first session was stopped after just one lap for seven drivers and did not start again for more than two hours.
When qualifying did finally re-start at 4.40pm local time - two hours and 40 minutes after it originally began - the track was still wet.
But Hamilton was a contender at the front throughout - second in the first session to Mercedes team-mate Valtteri Bottas and fastest in the second session from the Finn by more than 0.7secs.
But he saved the best until last. With the rain coming down harder again, the Red Bulls looked like they might be hard to beat but Hamilton pulled out a superb lap as the clock ticked down to zero to put it well beyond doubt.
"I am so happy," Hamilton said. "To do this here in such a historic circuit and beautiful country, I am going to have some pasta tonight to celebrate." RECEIVE NEWS UPDATE ON: WHATSAPP +234 701 056 0394, AND TWITTER: @247NGNEWSUPDATE, EMAIL: INFO@247NIGERIANEWSUPDATE.CO FOR INSTANT UPDATES ON INSTAGRAM CLICK HERE Share your story with us: firstname.lastname@example.org PLACE YOUR TEXT ADVERT BELOW:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>