Directly behind on the final lap, Hamilton - who had questioned race director Charlie Whiting on the radio whether a 10-second stop-and-go penalty was enough of a punishment for Vettel's driving - caught the Ferrari's slipstream out of the final corner and crossed the line just 0.2s adrift of the championship leader to come home fifth. The order saw Hamilton ahead of Vettel in the pits, with both cars requiring repairs after their collision.
But Bottas had to pit on the second lap for a new front wing, dropping to last, while Raikkonen complained of damage to the rear of his auto.
Though he was pipped to the Baku finish line by accomplished drivers like Daniel Ricciardo and Valterri Bottas, Stroll still managed to do something unthinkable.
Vettel finished fourth, while Hamilton was fifth. Hamilton, less angry in his media briefing than immediately after the race on television, maintained Vettel shunted him on goal.
While behind a safety auto Hamilton, who was in the lead, appeared to slow his vehicle right in front of Vettel, causing Vettel to drive into him.
"I don't have a problem with him", insisted Vettel.
The safety auto came out three times in quick succession before a red flag stopped the race on lap 22 of 51 because debris littered the track. When it came to the next safety vehicle restart, they were in the same position and guess what?
"We just stayed out of trouble".
The slowness of the safety vehicle was annoying Hamilton, who complained that he couldn't get enough temperature into his tires.
Wimbledon seed not a motivating factor for imperious Federer in Halle
Roger Federer defeated Germany's Alexander Zverev 6-1, 6-3 to win the Gerry Weber Open for a record ninth time on Sunday. Zverev has a shot at his fifth win over a top-10 player this season, as the 20-year-old continues his breakout season.
"I'm just lost for words right now", Stroll said after the race. It was a succinct summary of an incident, and a day, that left Vettel and F1 in disarray.
On the restart the Force India's of Esteban Ocon and Sergio Perez collided, allowing Ricciardo to sneak into fifth for the second restart - from which he duly passed the Williams pair of Felipe Massa and Stroll to move into third.
Within moments, the safety vehicle was out again for the third time after Sergio Perez and his Force India teammate Esteban Ocon collided.
Making the most of a series of extraordinary incidents and interventions in an action-packed race, which included three safety vehicle interventions and a red-flagged stoppage, Ricciardo, who started 10th, roared home 3.904 seconds ahead of the rest to deliver his first win of the season.
With debris littering the track, it was deemed too unsafe to race and the red flag came out on lap 22 of 51. In Spain last May, Hamilton had spoken about how enjoyable it was to be battling a rival who was not a team mate - his main opponent for the past three seasons - and the admiration he felt for Vettel's speed and consistency.
Hamilton, who led for much of a race that was red-flagged on lap 21 as the street circuit was cleared of debris, suffered his misfortune on the 32nd of 51 laps.
When Hamilton came back out again, he found himself behind Vettel and several others.
In a rare bright spot for McLaren, Fernando Alonso placed ninth for his team's first points of a frustrating season.