Dani Pedrosa will start from pole at the Malaysia Grand Prix after reigning MotoGP world champion and standings leader Marc Marquez could only qualify seventh following a crash.
Spaniard Pedrosa snatched pole at the death in Sepang on Saturday, leapfrogging Johann Zarco with his final lap as championship hopeful Andrea Dovizioso, 33 points adrift of Marquez coming into the penultimate race of the season, rounded out the top three.
Repsol Honda's Pedrosa clocked a time of one minute, 59.212 seconds for his first pole position since the Catalan GP in June.
"I'm very happy. It's my third pole of the year, it's very positive," Pedrosa said. "Starting from the front row is very important. No rain today so we'll hope for the same tomorrow."
Qualifying did not go according to plan for Pedrosa's team-mate Marquez after the champion went down at the final corner on his first flying lap.
Marquez returned to the circuit but he was unable to challenge the top three.
Seeking back-to-back world titles, Marquez will start behind Valentino Rossi, Maverick Vinales and Jorge Lorenzo on Sunday.
1. Dani Pedrosa (Repsol Honda) 1:59.212
2. Johann Zarco (Monster Yamaha Tech) +0.017s
3. Andrea Dovizioso (Ducati) +0.024s
4. Valentino Rossi (Movistar Yamaha) +0.286s
5. Maverick Vinales (Movistar Yamaha) +0.326s
6. Jorge Lorenzo (Ducati) +0.410s
7. Marc Marquez (Repsol Honda) +0.482s
8. Alex Rins (Suzuki Ecstar) +0.780s
9. Andrea Iannone (Suzuzki Ecstar) +0.907s
10. Cal Crutchlow (LCR Honda) +0.969s