The chaotic end meant Bottas moved up from second to 11th, while Hamilton, whose tire struggled on the final lap, held on to cross the line five seconds ahead of Max Verstappen in the pursuit.
Bottas’ late woes meant Ferrari’s Charles Leclerc completed the podium.
It was Hamilton’s third straight win after a delayed start to the season amid the coronavirus pandemic and sees him jump 30 points ahead of the championship.
“The last few laps I started backing up and then in the straight (the tire) just deflated,” Hamilton said after the race.
“I just noticed the change in shape a bit and it was definitely a heartfelt feeling in my mouth… I was just praying and trying to go around and not be too slow.”
“I almost didn’t get through the last two corners but there you go, we did and I really owe it to the team.
“I have certainly never experienced anything like this on a final lap. My heart almost stopped.”
Hamilton, Bottas and Verstappen had occupied the top three places on the grid and were unscathed for much of the race before the late drama.
If Verstappen hadn’t opposed before the last round, he probably would have taken the victory in Hamilton. “It’s good luck and bad luck,” Verstappen said, considering catching one Mercedes but not the other.
“They were too fast in the race. The tires at one point didn’t look great with 10 laps to go so I was already on the radio … then of course they boxed me to do the fastest lap.
“I’m very happy with the second, it’s a very good result for us.”
The safety car was put to work again in the opening stages when AlphaTauri’s Daniil Kvyat crashed heavily on lap 12. Fortunately, the Russian got out of his car and appeared unharmed.
As the drivers competed for places in the middle of the grid, Hamilton was unchallenged up front ahead of Bottas and Verstappen.
But late tire problems for several drivers – like Bottas, Renault’s Carlos Sainz also retreated after tire problems – will give the teams plenty to think about when racing returns to Silverstone next weekend.
This is the second time that this season’s shortened championship has traveled to the same circuit on consecutive weekends after the opening races in Austria.
The victory means Hamilton, who has also been victorious in Austria and Hungary, takes another small step towards Michael Schumacher’s record of seven league titles with 10 races to go.
While leading the driver’s standings with 88 points, Bottas remains second with 58 points, six ahead of Verstappen.