Sepang - Dani Pedrosa snatched pole position in the dying seconds of a thrilling qualifying session for the Malaysian MotoGP on Saturday as world title hopeful Marc Marquez recovered from a crash to finish seventh.
Marquez looked on course to set the fastest pace of the weekend in a real fast lap when he fell off his Honda.
Pedrosa, the Spanish Honda rider, came out on top after a furious finale which saw five successive pole laps set in the last two minutes - leaving the top seven riders covered by less than half a second.
Pedrosa's time of 1min 59.212sec was 17-thousandths quicker than Yamaha's Johann Zarco, with Andrea Dovizioso of Ducati another seven-thousandths behind to complete the front row.
Pedrosa later said he was happy with his machine, adding that starting in the front was important to get a podium finish.
"We hope Sunday's race will be dry. We hope to focus on the race and hopefully we will do our best," he said.
"Starting from the front is very important," he added.
Dovizioso's hopes of stopping Marquez clinching a second straight world title were buoyed when the Honda rider, who crashed at the end of one flying lap, finished outside the top six.
Dovizioso, riding a Ducati, said he was glad to start the race from the front ahead of Marquez who sits in the third row.
"I set a fast lap and it seems the bike is competitive in both wet and dry track," he said.
Meanwhile, Zarco of France on a Yamaha said he used medium tyres during the qualifying to record a strong lap time.
"I am ready to fight (for a podium finish). I am quite positive. I feel good," he said.
Spain's Marquez leads Dovizioso by 33 points going into the year's penultimate race, meaning he will be crowned world champion if he finishes first or second on Sunday.
Leading grid positions for Sunday's Malaysian motorcycling Grand Prix after qualifying at Sepang on Saturday:
1. Dani Pedrosa (ESP/Honda) 1:59.212
2. Johann Zarco (FRA/Yamaha Tech3) at 0.017
3. Andrea Dovizioso (ITA/Ducati) at 0.024
4. Valentino Rossi (ITA/Yamaha) at 0.286
5. Maverick Vinales (ESP/Yamaha) at 0.326
6. Jorge Lorenzo (ESP/Ducati) at 0.410
7. Marc Marquez (ESP/Honda) at 0.482
8. Alex Rins (SPA/Suzuki) at 0.780
9. Andrea Iannone (ITA/SUZUKI) at 0.907
10. Cal Crutchlow (GBR/LCR Honda) 0.969
11. Jack Miller (AUS/Honda) 1.114
12. Pol Espargaro(SPA/KTM) 1.558
1. Joan Mir (ESP/Honda) 2:12.078, 2.Jorge Martin (ESP/Honda) 2:12.457, 3. John McPhee (GBR/Honda) 2:12.816
4. Bo Bendsneyder (NED/KTM) 2:13.161, 5. Gabriel Rodrigo (ARG/KTM) 2:13.165, 6. Livio Lo (BEL/Honda) 2:13.311
7. Romano Fenati (ITA/Honda) 2:13.363, 8. Enea Bastianini (ITA/Honda) 2:13.374, 9.
Jules Danilo (FRA/Honda) 2:13.309