Marc Marquez held off a challenge from newly crowned champion Julian Simon to claim his second 125cc pole position of the season at Sepang.
KTM rider Marquez was half a second clear of the field going into the final laps, but looked set to lose out to Simon's Aspar Aprilia. But the champion lost a little time in the last sector and missed pole by 0.055sec.
Simon's teammate Bradley Smith held on to third despite a heavy crash at the last corner in the closing minutes. The Briton sat up straight afterwards and was alert, but required help from the marshals to leave the scene of the crash.
Sandro Cortese completed the front row, ahead of Nico Terol and Esteve Rabat.
Last week's Australian GP polesitter Pol Espargaro was only 11th this time. The Derbi rider went off early on and had to wait for his bike to be returned to the pits for repairs.
Also in trouble were Simone Corsi – left in 16th after crashing – and Sergio Gadea, who was two places further back due to a gearshift problem.
Pos Rider Bike Time Gap
1. Marc Marquez KTM 2m13.756s
2. Julian Simon Aprilia 2m13.811s + 0.055
3. Bradley Smith Aprilia 2m14.209s + 0.453
4. Sandro Cortese Derbi 2m14.231s + 0.475
5. Nicolas Terol Aprilia 2m14.403s + 0.647
6. Esteve Rabat Aprilia 2m14.686s + 0.930
7. Joan Olive Derbi 2m14.816s + 1.060
8. Danny Webb Aprilia 2m14.920s + 1.164
9. Efren Vazquez Derbi 2m14.975s + 1.219
10. Jonas Folger Aprilia 2m14.992s + 1.236
11. Pol Espargaro Derbi 2m15.019s + 1.263
12. Randy Krummenacher Aprilia 2m15.219s + 1.463
13. Andrea Iannone Aprilia 2m15.282s + 1.526
14. Lorenzo Zanetti Aprilia 2m15.374s + 1.618
15. Takaaki Nakagami Aprilia 2m15.436s + 1.680
16. Simone Corsi Aprilia 2m15.455s + 1.699
17. Scott Redding Aprilia 2m15.484s + 1.728
18. Sergio Gadea Aprilia 2m15.529s + 1.773
19. Stefan Bradl Aprilia 2m15.533s + 1.777
20. Luis Salom Aprilia 2m15.951s + 2.195
21. Dominique Aegerter Derbi 2m16.278s + 2.522
22. Johann Zarco Aprilia 2m16.364s + 2.608
23. Michael Ranseder Aprilia 2m16.530s + 2.774
24. Cameron Beaubier KTM 2m16.533s + 2.777
25. Elly Ilias Aprilia 2m17.952s + 4.196
26. Tomoyoshi Koyama Loncin 2m18.348s + 4.592
27. Jasper Iwema Honda 2m18.572s + 4.816
28. Jakub Kornfeil Loncin 2m18.749s + 4.993
29. Blake Leigh-Smith Honda 2m19.624s + 5.868
30. Muhammad Zulfahmi Yamaha 2m19.655s + 5.899
31. Luca Marconi Aprilia 2m19.868s + 6.112
32. Luca Vitali Aprilia 2m21.127s + 7.371
33. Quentin Jacquet Aprilia 2m21.148s + 7.392