Sandro Cortese snatched pole position for the 125cc Italian Grand Prix by just 0.021sec on his very last lap of Saturday's qualifying session.
Pol Espargaro, winner of the last two races, had been holding pole up to that point - but spent the end of the session watching from the pits after a big accident.
The Tuenti Derbi rider, who has closed to within two points of title leader Nico Terol, was sent spinning through the air with ten minutes to go and could only watch helplessly as Cortese tucked in behind Terol and took pole by 0.021sec.
That also knocked 2009 Mugello winner Bradley Smith to third, with the Englishman's Aspar Aprilia team-mate Terol completing the front row in fourth.
Randy Krummenacher heads row two from double 2009 pole sitter Marc Marquez, with Esteve Rabat starting seventh. Espargaro's team-mate Efren Vasquez also fell after claiming eighth on the grid.
Qualifying - Mugello:
1. Cortese (Derbi) 1m 58.315s
2. Espargaro (Derbi) +0.021s
3. Smith (Aprilia) +0.257s
4. Terol (Aprilia) +0.271s
5. Krummenacher (Aprilia) +0.367s
6. Marquez (Derbi) +0.390s
7. Rabat (Aprilia) +0.862s
8. Vazquez (Derbi) +1.026s
9. Zarco (Aprilia) +1.302s
13. Webb (Aprilia) +1.816s