Vettel pulled away to open a three seconds lead ahead of Hamilton and Bottas after 10 of the scheduled 51 laps of the tight and fast Baku street track. Further back, Vettel was overtaken by Sergio Perez who took third place.
Bottas managed to pass Vettel after coming out ahead following a pitstop and looked set to take his Mercedes home after an attempted passing move from Vettel went horribly awry as the German dropped out of contention.
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. Both are seeking their fifth world title.
With the Grand Prix Circus returning to Europe with the Spanish Grand Prix in a fortnight it could all get really quite interesting. He praised his teammate for his exceptional job, and he stated that Bottas really deserved to win. "It was definitely a very untidy race from me, but I've got to take it because I didn't give up and I kept pushing".
Behind the top four it was Sainz in the Renault, a cracking drive from Leclerc in the Sauber, points for Alonso and McLaren with a seventh place finish, Stroll giving Williams their first points of the season in eighth, Vandoorne adding to McLaren's points tally in ninth and Hartley taking the last points position for Toro Rosso. Max Verstappen seized the initiative, overtaking Daniel Ricciardo with an aggressive move into Turn 2 after the first Safety Car restart.
It was a race where the safety auto once more played a massive role, with series of crashes. That in turn left Sirotkin out of the race and Fernando Alonso limping back to the pits with two punctures.More news: Champions League: Salah leads Liverpool to semifinal win vs. Roma
Or was it? On Lap 44, Romain Grosjean inexplicably lost control while weaving under the safety vehicle and ploughed into the wall.
His puncture handed the win to his Mercedes team-mate Lewis Hamilton, who now heads the driver's championship by four points from Vettel in second.
Apart from the Red Bulls' efforts to self-destruct in spectacular fashion, the Ferrari team's decision to bring Vettel in for a pit stop with around a dozen laps to go and allowing Bottas to take over the lead seemed unwise at the time and even more so in retrospect. Sebastian eventually followed suit on Lap 30, but Valtteri stayed out - Mercedes figured his worst result would be third but that a well-timed safety vehicle would allow him to make a free pit stop and keep his lead from the Ferrari.
They banged wheels on the exit of turn one on lap 27 when Verstappen slid under braking and pushed Ricciardo up against the wall.
Bottas and Mercedes played the ideal waiting game in Baku on Sunday as the Finn ran a long first stint in the hope of a Safety Car.