Bottas survived a lunge from Vettel into Turn 1 at the subsequent safety vehicle restart and appeared to be heading for victory before a puncture handed Mercedes' first win of the year to Hamilton, with Kimi Raikkonen second and Sergio Perez beating Vettel to a shock third.
"That was quite an emotional race, to be honest", said hamilton, who now leads the championship by four points from Vettel.
The track out the safety vehicle, which allowed Bottas, which is longer than the others avoided the only pit stop in the race to be ahead of Vettel.
The race was heavily punctuated by accidents which included one in which the two Red Bulls of Daniel Ricciardo and Max Verstappen collided while fighting for fourth place in the closing stages, the pair having banged wheels and battled for positions throughout the race.
Sebastian Vettel finally yielded his lead as he pitted on lap 31 surrendering the top spot to the Mercedes of Bottas. "If we can manage that, I think we've got a real good handling race vehicle". Ricciardo locked up his tyres as his teammate's gearbox appeared in front of him and he clattered into the back of Verstappen, taking both cars out of the race.
Their collision, which provoked Red Bull team principal Christian Horner to demand that both of his millionaire drivers next week apologise to the team's 800 staff at their Milton Keynes factory, paved the way for Bottas to lead by virtue of pitting for new tyres under the safety vehicle.
It forced the Finn out of the race and handed the lead to Hamilton with just three laps remaining. Hulkenberg's race came to an end when he lost the rear of his vehicle at Turn 5 and hit the wall, while Sainz dropped down the order with an early pit stop but eventually went on to finish fifth following retirements further ahead. That delayed the restart, and when it came Vettel charged down the inside of Bottas but couldn't slow enough to make the corner and went onto a runoff area. Sadly for Red Bull, it ended with both drivers out of the race. It is always going to be an issue and this time it is just unlucky. Sergio Perez was third, again coming from behind.
Bottas had been left in the lead when first Hamilton, then Vettel, stopped for fresh tires.
That kept the safety vehicle out for another five laps. A big fight for victory seemed likely but with just eight laps left till the end of the race, Haas-Ferrari's Romain Grosjean crashed while trying to keep heat in his tyres. Ricciardo's second retirement this season leaves him fifth, 33 points off the lead.
Ricciardo braked late and ran into the back of the younger man, who was attempting to cut back across and prevent his progress.