Verstappen will line up only in 15th, but Perez salvaged some joy for Red Bull by beating Ferrari's Charles Leclerc to second, with Fernando Alonso third for Aston Martin.
George Russell finished fourth, but his Mercedes team-mate Lewis Hamilton qualified only eighth.
Verstappen had been the odds-on favourite to race to top spot under the lights in Jeddah after he topped all three practice sessions in his dominant Red Bull machine.
But drama struck for the Dutchman in Q2 when a suspected driveshaft issue hit his Red Bull.
Verstappen gingerly limped back to the pits, but with fewer than seven minutes remaining, his mechanics were unable to resolve the failure.
Verstappen's qualifying was dramatically over and his father Jos removed his headphones despondently at the back of the Red Bull garage.
Verstappen crushed his rivals a fortnight ago in Bahrain and - following a supreme run in practice - the Dutchman had been expected to take pole and cruise to a second win in as many races.
But his early exit means he will have to carve his way back through the field at the fastest street circuit on the Formula One calendar.
Verstappen's premature end levelled up the playing field and all eyes were suddenly on Alonso and whether the Spaniard, in his rejuvenated Aston Martin, might capture his first pole since the German Grand Prix in 2012.
But it was Perez who marched to the second pole of his career at the same venue where he claimed his maiden qualifying triumph a year ago.
Leclerc finished 0.155 seconds adrift, with Alonso almost half-a-second back. However, Alonso will be promoted to the front row as Leclerc serves a 10-place grid penalty after he took on a new electronics control unit.
Russell finished six tenths back and the best part of four tenths clear of Hamilton on an underwhelming evening on the Red Sea for the seven-time world champion.
Lando Norris's evening ended abruptly in Q1 after he banged his McLaren into the wall at the 27th and final bend.
Norris stopped for repairs, but his team were unable to fix the damage to the front-left of his machine, leaving the British driver a lowly 19th on the grid for Sunday's race.
Only Logan Sargeant will start behind Norris after the American rookie failed to get a lap together in an error-strewn Q1 display.