Hamilton and Mercedes had been comfortable until Valtteri Bottas' front-left tyre failed on lap 50 of 53.
On the final lap, the same failure occurred on Hamilton's car when he was some 32 seconds ahead of Max Verstappen, who had inherited second position.
Hamilton three-wheeled it home and crossed the line just five seconds ahead of Verstappen. He admitted the team should have pitted in the closing stages when the severity of the issue became clear.
Explaining the final couple of laps, Hamilton said: "That last lap, until that last lap everything was relatively smooth sailing the tyres felt great...
"Valtteri was really pushing incredibly hard, and I was doing some management of the tyre and he looked like he wasn't. When I heard that his tyre went, I was just looking at mine and everything seemed fine.
"The car was still turning no problem so I thinking, 'maybe it's ok' and those last few laps I started to back off and down the straight it deflated and I just noticed the shape just shift a bit that was definitely heart in the mouth feeling because I wasn't quite sure it had gone down until I hit the brakes. And then you could see the tyre was falling off the rim.
"Just driving it trying to keep the speed up, sometimes it will take off and break the wing I was just praying it would get round and it would not be too slow, I nearly didn't get round the last two corners. But thank God it did, I really owe it to the team, ultimately we should have stopped towards the end once we saw the delamination."
Despite the tense situation of the final lap, Hamilton said his heart rate was going down, not up, even with race engineer Peter Bonnington counting the chasing Verstappen's gap to him on the final lap.
"You'd be really surprised, well may or may not be surprised, but I was really chill for some reason at the end.
"Bono was giving me the information of the gap I think it was 30 seconds at one stage, it was coming down quite quickly and in my mind I'm thinking like 'how far is it to the end of the lap?'
"I got to 15 and that's where it was a bit of a struggle and I could hear the gap coming down from 19 to 10 and I remember giving it full gas out of 15 down to 16 and the thing wasn't stopping . So I got to the corner and a lot of understeer and I heard him go 9, 8, 7 [seconds] and I was like 'just get back to the power' trying to get it to turn.
"Oh my god. I've definitely never experienced anything like that on the last lap. And my heart definitely probably nearly stopped.
"I think that's probably how cool I was, because my heart nearly stopped."