Hamilton swept to the 96th pole position of his F1 career on Saturday at the Sochi Autodrom, beating Red Bull's Max Verstappen by over half a second in the final stage of qualifying.
But Hamilton was fortunate to make it that far after barely making it across the line in time to set a lap in Q2 after his initial effort was scrubbed.
The stewards deleted Hamilton's first lap in Q2 after he ran wide at Turn 18, prompting Mercedes to bring him in and opt for a second run on the medium compound tyre instead of keeping him out.
A red flag caused by a crash for Sebastian Vettel forced Hamilton to abandon his second run, and left him up against it to get a lap time on the board with just 2m15s left on the clock.
Hamilton crossed the line with one second to spare before going fourth with his lap on the soft tyre to make it into Q3, where he subsequently took pole position for the eighth time in 10 races.
"It was one of the worst qualifying sessions," Hamilton said. "It was horrible. Heart in your mouth, the whole way. The first one, I got the time taken away obviously, which is the first time I've gone wide there the whole weekend.
"I wanted to stay out and do another lap just to get a banker, but they said come in and get new tyres, and then the red flag came out.
"It was a real risk once we got out on that next tyre at the end, and ultimately I'm starting on the soft tyre which is not good."
Hamilton will start ahead of Verstappen and Mercedes teammate Valtteri Bottas on the grid tomorrow, but feared he would be powerless to stop them from passing on the long run to the first braking zone at Turn 2.
"It's nice being on pole, but here's probably the worst place to be on pole with the draggier cars this year," Hamilton said.
"Undoubtedly I'm most likely to get dragged past tomorrow. The guys I'm racing against, they are both on the medium tomorrow, so it's definitely going to make it hard to win the race.
"But nonetheless, I'm going to stay positive, try and figure out how can navigate my way through, get a good start, whatever it may be, and we'll see."