The world champion was fortunate in that he had a 30-second gap back to Red Bull's second-placed Max Verstappen in the final lap.
Hamilton just beat his rival over the line as one of his front tyres suffered a puncture in the closing moments.
He was not the only one to encounter massive problems at the end of the Grand Prix, though.
Mercedes team-mate Valtteri Bottas and Carlos Sainz also had tyres explode in the last couple of laps, costing them points in the Championship table.
Bottas ended up way down in 11th place, having been second with only a few laps to go.
Ferrari’s Charles Leclerc, meanwhile, capitalised on the late chaos to pinch third place and a spot on the podium.
Drivers will be back at Silverstone next week and softer tyres will be used, which raises big questions for Pirelli after today’s madness.
Get the latest transfer news straight into your inbox!
Sign up for the brilliant new Daily Star Sport email newsletter!
From the latest transfer news to the agenda-setting stories, get it all in your email inbox.
Put your email in the box at the top of this article or you can follow instructions on this link here.
The front left takes a load on the Silverstone track, so an inquest is expected ahead of next weekend.
The radio messages, from those who finished on the podium, after the chequered flag said it all.
Verstappen said: ""He is a lucky boy. He is a lucky boy."
While eventual winner Hamilton admitted: "That was close."
After the race, Hamilton said: “Up until that last lap everything was relatively smooth sailing. Valtteri was really pushing incredibly hard, I was doing some management of the tyre. When I heard his went I looked at mine and it seemed fine.
"The car was turning no problem, last few laps I started to back off and then last lap it deflated. That was a heart in the mouth moment. You could see it falling off the rim. From then I was just managing it and I was just praying to get round and not be too slow. I didn't think I would make it round the last two corners.
"I was really chilled for some reason at the end. Bono was giving me the information about the gap. It was coming down quite quickly but the car seemed to turn OK. I got to 15 and that is where it was a struggle so I gave it full gas out of there down to 16.
"I have definitely never experienced anything like that on the last lap and my heart definitely nearly stopped."
Verstappen added: "It was lucky and unlucky. The Mercedes were too quick. The tyres didn’t look great with 10 laps to go, they didn’t look pretty.
"Valtteri [Bottas] got a puncture, then they boxed me to go for the fastest lap, then Lewis [Hamilton] got a puncture. But second is a good result.
"I told my engineer to drink and to stay hydrated! It was pretty lonely; I was just managing my pace and looking after the tyres."