Hamilton appeared on course to cruise to victory but limped over the line, virtually on three wheels, following the late drama at Silverstone.
Red Bull's Max Verstappen crossed the line just five seconds back, having started the last lap 31 seconds behind Hamilton.
Valtteri Bottas had looked set to take second spot, but also suffered a puncture with two laps to run, dropping him to 11th.
Verstappen stopped for new tyres following Bottas' puncture. Had he not pitted, he would have been close enough to take the win off Hamilton.
Ferrari's Charles Leclerc finished third ahead of Renault's Daniel Ricciardo with Lando Norris fifth.
The safety car was deployed on two occasions at Silverstone following high-speed shunts involving Kevin Magnussen, and then Daniil Kvyat.
But Hamilton kept his cool at both restarts, leading from start to finish, despite the puncture, to move 30 points clear of Bottas in his seemingly inevitable march towards a record-equalling seventh world crown.
"Up until that last lap, everything was smooth sailing," Hamilton said.
"When I heard Valtteri's tyre went I looked at mine and everything seemed fine.
"The car was still turning, and the last laps I started to back off and then the tyre deflated.
"It was definitely heart in the mouth. You could see the tyre was falling off the rim.
"Oh my God, I was just praying to get it round. I nearly didn't do it, but thank God we did.
"I had never experienced anything like that on the last lap. My heart almost stopped."
Hamilton recovered from a rare spin in qualifying to take pole with the fastest lap ever recorded at Silverstone, and, after beating Bottas to the opening bend, his victory did not appear in doubt until the late drama.
Bottas got a better getaway than Hamilton, but, after failing to draw alongside his team-mate before the first corner, he backed out of a lunge for the lead.
Alexander Albon compounded a poor weekend by banging wheels with Magnussen on the opening lap, sending the Haas driver into the gravel.
The safety car was deployed and Albon was dealt a five-second penalty from the stewards. He would cross the line in eighth, with pressure mounting on the under-performing London-born Thai.
After Magnussen's damaged machine was cleared away, the race restarted on lap six, but Bottas failed to put Hamilton under any pressure.
Just seven laps later, the safety car was deployed again after Kvyat lost control of his AlphaTauri through the high-speed Maggots.
The Russian thudded into the barriers but despite sustaining serious damage to his car walked away unscathed from the incident. "I am so f****** sorry," he said over the radio before shoving a camera out of his way as he returned to the pits.
The second safety car period saw the drivers stop for fresh rubber, and once Kvyat's wreckage was cleared, Bottas again did not do enough to put Hamilton under any pressure on the restart.
Instead, it was Norris on the move after he stormed past Ricciardo at Luffield before attempting to take team-mate Carlos Sainz around the outside at Copse. The young Briton, however, was forced to abandon the ambitious move.
Sainz and Norris then made their way past Romain Grosjean - the Haas driver running in fifth after choosing not to pit for tyres during the safety car. The Frenchman was handed a black-and-white flag by the stewards for his aggressive defence when duelling with Sainz.
British Grand Prix positions
1 Lewis Hamilton (Gbr) Mercedes GP 1hr 28mins 01.283secs
2 Max Verstappen (Ned) Red Bull +5.856
3 Charles Leclerc (Mon) Ferrari +18.474
4 Daniel Ricciardo (Aus) Renault +19.650
5 Lando Norris (Gbr) McLaren +22.277
6 Esteban Ocon (Fra) Renault +26.937
7 Pierre Gasly (Fra) Scuderia AlphaTauri +31.188
8 Alexander Albon (Tha) Red Bull +32.670
9 Lance Stroll (Can) Racing Point +37.311
10 Sebastian Vettel (Ger) Ferrari +41.857
11 Valtteri Bottas (Fin) Mercedes GP +42.167
12 George Russell (Gbr) Williams +52.004
13 Carlos Sainz (Spa) McLaren +53.370
14 Antonio Giovinazzi (Ita) Alfa Romeo Racing +54.205
15 Nicholas Latifi (Can) Williams +54.549
16 Romain Grosjean (Fra) Haas F1 +55.050
17 Kimi Raikkonen (Fin) Alfa Romeo Racing +1 lap
Daniil Kvyat (Rus) Scuderia AlphaTauri 12 laps completed,
Kevin Magnussen (Den) Haas F1 1 lap completed,
Nico Hulkenburg (Ger) Racing Point Did not start - power unit issues
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies