Mercedes has largely struggled in 2022 but was hopeful of a stronger result on Singapore's twisty street circuit, and with qualifying held in wet-to-dry conditions, it afforded the Brackley team a chance to shine.
And while teammate George Russell could only manage P11 after reporting an issue, Hamilton set the fastest lap early on in Q3 and looked set to battle for pole.
But with the track conditions improving rapidly, the final lap would prove crucial and after a flurry of late improvements Hamilton had to settle for third, just 0.054s behind Ferrari's polesitter Charles Leclerc and 0.032s behind Red Bull's Sergio Perez.
Afterwards, Hamilton felt he had a shot at pole with a perfect final lap but said he "just didn't have the grip" to take it.
"I was pushing so hard, it was so, so close. It was trying so hard," he said. "These guys are always so quick, but I really thought maybe with a perfect lap, which was really hard to get, that we could be fighting for first place.
"I just didn't have the grip in the last lap but nonetheless, I'm grateful to be on the second row. And I'm grateful to the team for continuing to push and we just keep our head down, hopefully tomorrow will be a better day."
While Hamilton was pleased to see Mercedes performed much stronger than in the preceding Italian Grand Prix, he was still frustrated to lose out by a tiny margin.
"We didn't know how close we would be this weekend," he explained. We knew that the car will be stronger than it was in Monza, but we didn't know how close it would be.
"But to lose out by just that bit...it was just okay. We will just get up and fight again tomorrow."
After qualifying Mercedes was summoned by the FIA stewards over filing an inaccurate scrutineering form on Hamilton's car.
Earlier on Saturday, the seven-time world champion had also been summoned himself for a potential breach of F1's jewellery ban.
Motorsport.com understands that the scrutineering form summons is related to the jewellery issue, and pertains to the nose stud that Hamilton is wearing in Singapore.