Alex de Angelis took his first Moto2 pole position at Phillip Island, denying Scott Redding in the final moments.
Redding, who has missed out on pole at the last minute several times this year, seemed certain to secure the top spot on this occasion as he took the provisional top spot once the field switched to slicks mid-session, and then repeatedly improved his pace.
Andrea Iannone looked like he might manage to edge Redding, only to have a fall, and with the rain appearing set to return, Marc VDS Suter rider Redding looked assured of pole. However, the rain held off, and de Angelis (JiR Motobi) dodged through the traffic to set a 1m35.148s and beat Redding by 0.2 second as the flag came out.
Stefan Bradl returned to the front row in third on the Kiefer Suter, alongside Aspar Suter's Mike di Meglio, who took his best start of the season in fourth.
Iannone recovered from his incident with nothing worse than a muddy Speed Up and proceeded to qualify fifth, ahead of Julian Simon (Aspar).
Champion Toni Elias (Gresini Moriwaki) struggled to get a lap in when the track was dry, and only salvaged ninth late on, while last week's winner Roby Rolfo crashed and tumbled to 25th place.
The session started out wet following the shower at the end of MotoGP qualifying, and Australian Superbike rider Wayne Maxwell impressed on his debut for Matteoni Racing in the conditions, taking provisional pole for a while before everyone switched to slicks. He was quick in the dry too and will start from 11th place.