Hector Barbera snatched pole position from Marco Simoncelli on his very last lap ahead of tomorrow's 250cc British Grand Prix.
The Pepe Aprilia rider got within one hundredth of a second of the Gilera rival with just a handful of seconds to go in the 45-minute session at Donington Park, but the Spaniard's last lap of 1m31.802s put him ahead of the Italian by 0.092s.
With 13 minutes left Simoncelli managed to demote Scot Honda rider Hiroshi Aoyama, who had been leading until then, down to second, and there he stayed until Barbera's final laps pushed him into third, with Blusens Aprilia's Alex Debon completing the front row.
Mike di Meglio will lead the second row, ahead of Aspar Aprilia team-mate Alvaro Bautista and Mattia Pasini, who crashed his Toth Aprilia with three minutes remaining and had to walk to the pits.
Thai Honda's Ratthapak Wilairot qualified eighth, followed by the Aprilias of Karel Abraham and Lukas Pesek rounding up the top ten.
Germany's 43-year-old Ralf Waldmann, who last raced in the world championship in 2002 after winning 14 races in the 250cc class, managed to qualify in 20th place on his one-off return with Kiefer Aprilia while standing for injured Vladimir Leonov.
Pos Rider Bike Time Laps
1. Hector Barbera Aprilia 1m31.802s 24
2. Marco Simoncelli Gilera 1m31.894s + 0.092s 20
3. Hiroshi Aoyama Honda 1m32.055s + 0.253s 21
4. Alex Debon Aprilia 1m32.268s + 0.466s 21
5. Mike Di Meglio Aprilia 1m32.643s + 0.841s 22
6. Alvaro Bautista Aprilia 1m32.664s + 0.862s 23
7. Mattia Pasini Aprilia 1m32.883s + 1.081s 18
8. R.Wilairot Honda 1m33.046s + 1.244s 21
9. Karel Abraham Aprilia 1m33.145s + 1.343s 22
10. Lukas Pesek Aprilia 1m33.203s + 1.401s 20
11. Raffaele De Rosa Honda 1m33.218s + 1.416s 24
12. Thomas Luthi Aprilia 1m33.360s + 1.558s 17
13. R.Locatelli Gilera 1m33.405s + 1.603s 22
14. Hector Faubel Honda 1m33.503s + 1.701s 22
15. Jules Cluzel Aprilia 1m33.622s + 1.820s 20
16. Alex Baldolini Aprilia 1m33.768s + 1.966s 20
17. Shoya Tomizawa Honda 1m33.901s + 2.099s 22
18. Imre Toth Aprilia 1m34.661s + 2.859s 21
19. Axel Pons Aprilia 1m35.351s + 3.549s 23
20. Ralf Waldmann Aprilia 1m35.408s + 3.606s 21
21. Valentin Debise Honda 1m35.600s + 3.798s 23
22. Balazs Nemeth Aprilia 1m36.202s + 4.400s 20
23. Bastien Chesaux Honda 1m36.309s + 4.507s 22
24. Luke Mossey Aprilia 1m37.227s + 5.425s 20
- Aitor Rodriguez Aprilia 1m38.638s + 6.836s 14
- Alex Kenchington Yamaha 1m38.657s + 6.855s 23
- Robin Halen Aprilia 1m41.680s + 9.878s 19