Entering the round, Max Verstappen held a four-point lead in the Drivers' Championship over Lewis Hamilton following his Monaco victory. Red Bull Racing also led Mercedes by one point in the Constructors' Championship. The 6.003-kilometre Baku City Circuit was considered a track that suited both leading teams.
Qualifying on 5 June produced four red flags — tying a record set at the 2016 Hungarian Grand Prix. Lance Stroll, Antonio Giovinazzi, Daniel Ricciardo, Yuki Tsunoda, and Carlos Sainz Jr. each caused separate accidents across the three segments. Charles Leclerc took pole position for the second consecutive event, ahead of Lewis Hamilton and Max Verstappen. Verstappen described his third-place result as stemming from "a stupid qualifying." Lando Norris received a three-place grid penalty for failing to comply with red flag procedures in Q1. Valtteri Bottas could only manage tenth, eight places behind his Mercedes teammate Hamilton, and said "something is wrong" with his car after the session.
Before the start, a moment of silence was observed in memory of former FIA president Max Mosley and McLaren shareholder Mansour Ojjeh. Leclerc retained the lead at the start. Hamilton passed him on the main straight at the end of lap 3, with Verstappen passing Leclerc three laps later. Pérez worked his way from sixth into fourth by the early laps.
Hamilton was the first of the top three to pit; his exit was delayed by around two seconds when Pierre Gasly drove the pit lane behind him. Verstappen pitted the following lap, giving Pérez a brief lead before he also stopped. A slower-than-expected stop due to a rear-right wheelgun problem left Pérez exiting behind Leclerc. Following the stops, both Red Bulls jumped Hamilton, dropping him to fourth. Vettel, yet to stop, held the lead temporarily before pitting into seventh, using his fresh tyres to overcut Tsunoda. The order stabilised with Hamilton unable to find a way past Pérez across the following laps.
On lap 30, Lance Stroll — the sole driver to have started on the hard compound without pitting — suffered a left-rear tyre failure exiting turn 20, crashing into the barriers. The safety car was deployed. Stroll's stricken car blocked the pit entry, closing the pit lane briefly. None of the front runners elected to change tyres during the safety car period. Racing resumed on lap 36.
Verstappen set the race's fastest lap on lap 44. Two laps later, his Red Bull RB16B suffered a left-rear tyre failure at high speed on the main straight, causing him to spin and crash into the barriers roughly 50 metres short of the finish line. A second safety car was deployed, and race director Michael Masi ordered the field through the pit lane to bypass the scene. Williams driver Nicholas Latifi misunderstood the instruction "stay out" — interpreting it as a directive not to enter the pit lane, when all cars were in fact required to pass through it — and received a 30-second post-race penalty as a result. Masi subsequently red-flagged the race after Red Bull's Jonathan Wheatley argued there were insufficient laps remaining to clear the accident under safety car conditions and that fresh tyres were needed to prevent further failures.
After a 34-minute delay, the race restarted on lap 50 with a standing start from the positions held at the time of the red flag, with Pérez leading and Hamilton second. Pérez was slow away from the line. Hamilton attempted to pass on the inside at turn 1 but had inadvertently selected the wrong brake mode and locked up at high speed, running onto the escape road and dropping to last place. The error had significant consequences for Hamilton's championship position at the end of the season.
A fight between Pierre Gasly and Charles Leclerc followed on the penultimate lap, with Gasly prevailing having exchanged positions twice down the main straight. Pérez led to the finish ahead of Vettel and Gasly. Leclerc, Norris, Alonso, Tsunoda, Sainz, Ricciardo, and Räikkönen completed the top ten, with Räikkönen scoring his first point of the season.
Pérez won his second Formula One race and his first for Red Bull Racing — the first Red Bull victory by a driver other than Verstappen since Daniel Ricciardo's win at the 2018 Monaco Grand Prix. Vettel's second place was his only podium for Aston Martin and the final podium finish of his Formula One career. Gasly's third was the last podium for Scuderia AlphaTauri before the team was rebranded. Both Mercedes drivers failed to score points despite finishing the race for the first time since the 2012 United States Grand Prix.
Pirelli launched a formal investigation into the tyre failures suffered by Stroll and Verstappen, with initial findings suggesting debris may have been a contributing factor. Several drivers, including Leclerc, publicly questioned the delay in deploying the safety car following Verstappen's crash. Masi defended his decision to restart the race with two laps remaining from a standing start. The result significantly shifted the dynamics of the 2021 title battle.