Verstappen had been four points clear of reigning world champion Lewis Hamilton at the start of Sunday's race and had looked on course to win the 13th win of his career but suffered a dramatic tire blow out in the grand prix's closing stages
With five laps remaining the Red Bull driver's luck ran out as his left-rear tyre punctured and he crashed into the concrete wall.
Verstappen was unable to contain his frustration as he got out of his car and kicked the blown tire.
The race was then suspended to clear debris strewn across the track.
The suspension offered Hamilton the chance to potentially win the grand prix or at least finish second and pull ahead of Verstappen in the drivers' title race, but seeking to jump Perez at the restart the Briton ran off the track as he locked up.
Perez sped away to secure his first victory for Red Bull and only the second of his career.
Sebastian Vettel claimed second to give Aston Martin its first podium in F1, while Pierre Gasly finished third in the Alpha Tauri.
"I'm so happy for today," said Perez after his victory. "Normally Baku is pretty crazy but I have to say sorry to Max.
"He deserved the win today and it would have been good for the team to get a one-two but the win is a fantastic result."
Hamiiton described his conclusion to the race as "quite a humbling experience."
"We've worked so hard to come back into the top 10 and I put everything on the line but just lost out in the end," Hamilton told Sky Sports.
"I clipped a switch that places the brakes off so I just went straight on at turn one on the restart. I'm very sorry to the guys and girls in the team. I had no idea that I've even touched the 'magic' switch."
Prior to Sunday, Hamilton had secured 54 successive top-10 finishes, a run going back to July 2018 when he had to retire at the Austrian Grand Prix. The Briton didn't take part in the 2