Hamilton took risks in the opening session by using the super-soft tyres while the rest of the field were on hyper-soft.
But the gamble just about paid dividends as he scraped through Q1 in 13th place.
The Mercedes star then had a fresher pair of wheels for the latter sessions – which he put to good use with a blistering opening lap in Q3.
Red Bull’s Max Verstappen came the closest to knocking Hamilton off pole but he was still three-tenths behind the four-time world champion.
And Hamilton even stunned himself with how well he drove.
“Wow, wow. That was a hard qualifying session,” Hamilton said.
“That lap felt like magic. I don’t know where it came from but it all came together.
“Huge thank you to all the team back in the factory. Everyone is working so hard to pull out extra bits. For that one lap I managed to get it right.
“It is great to see so many people here. Singapore is a wonderful track.
“Honestly I’m super overwhelmed. My heart is racing. I might have an anxiety attack in a minute.
“I don’t think there was a moment in the lap that was wide or any problems. It was just perfectly to the limit. It felt like one of the best laps I remember feeling.”
Hamilton’s World Championship rival Sebastian Vettel could only secure third place and he was bitterly disappointed.
“It’s not ideal,” Vettel said.
“We wanted to get pole, we didn’t. For us it was a bit of a messy qualifying session. At the end there was too much time missing.
“It’s never ideal when you have mini races on the out lap but there were a lot of cars around.
“I can’t blame it on that, in the end we had two laps and they were both not good enough. I think we have a good race car. It’s a bit more difficult further back but I think we have.”