Rain hit the Malaysian track midway through the pre-qualifying FP4 session, its sudden arrival catching out Maverick Vinales, Jordi Torres and Karel Abraham in quick succession.
Vinales, incensed by the lack of rain flags, destroyed one of his two Yamahas in his crash, and Abraham appeared to have hurt his left hand - but both carried on to qualifying, whereas Torres was ruled out for the rest of the weekend after suffering a fractured finger.
By the time the first segment of qualifying kicked off, the rain had become torrential, and soon after riders rode out for their Q1 out-laps the action was red-flagged due to standing water on track.
Malaysia Grand Prix
Vinales: Matching Rossi/Marquez was impossible
05/11/2018 AT 13:40
It took over an hour for the rain to ease off sufficiently to allow track action to resume.
Marquez was into the lead with his first effort in the pole shoot-out - and while he only narrowly led Jack Miller and Andrea Iannone at the start, he went over a second clear with his second attempt.
He was again up on his personal best when he suffered a low-speed crash at the Turn 4 right-hander, before remounting his Honda and heading into he pits for a bike change.
Marquez could not improve on his second RCV213, but his rivals couldn't threaten his early time of 2m12.161s.
Johann Zarco came closest at the chequered flag, the Tech 3 rider going 0.548s slower than Marquez to snatch second place from the works Yamaha of Valentino Rossi.
Iannone followed Rossi in fourth, while Ducati's Andrea Dovizioso took fifth after falling on his final lap.
Pramac Ducati pair Miller and Danilo Petrucci were sixth and seventh respectively, ahead of Suzuki's Alex Rins and Nieto Ducati rider Alvaro Bautista, who had topped Q1.
Marquez's Honda teammate Dani Pedrosa, Vinales and Aprilia's Aleix Espargaro, who progressed through Q1 with Bautista but crashed in the pole shoot-out, made up row four.
Michele Pirro, who replaced Ducati works rider Jorge Lorenzo at late notice ahead of FP3, qualified a credible 13th.
KTM's Bradley Smith had led Q1 after the initial runs but crashed at the Turn 11 right-hander, and was consigned to 17th as he couldn't make it to his second bike in time to do another lap.
Thomas Luthi also crashed his privateer Honda, but had done a time good enough for 18th and outqualified Marc VDS team-mate Franco Morbidelli for only the second time this season.
Stefan Bradl, Cal Crutchlow's stand-in at LCR Honda, was 20th, while local hero Hafizh Syahrin propped up the classification and will start 23rd on his Tech 3 Yamaha.
Malaysia Grand Prix
Zarco gains pole after Marquez impeding penalty
03/11/2018 AT 12:00
Malaysia Grand Prix
Rins set scorching fastest practice time on pitlane fire bike
02/11/2018 AT 10:40