Andrea Dovizioso qualified fastest at the Czech Republic Grand Prix to deny Marc Márquez pole position in his 100th MotoGP race.
World champion and season leader Márquez was chasing a 49th pole - and a third in a row - as he brings up a century of races and looked to have done enough when he claimed top spot late in Q2.
Jorge Lorenzo put down the early marker, but Márquez was the first rider to go round in under one minutes and 55 seconds with his final lap.
Dovizioso was still out on the track, though, and he flew across the finish line to move to the summit, with Valentino Rossi, previously slow, also going faster than Márquez.
Lorenzo was pushed off the front row, while Márquez insisted he was happy to qualify in third.
"For one lap, I knew it would be difficult," he told BT Sport. "The target was to be on the front row. On race pace, we [himself and Dovizioso] are very similar."
1. Andrea Dovizioso (Ducati): 1:54.689secs
2. Valentino Rossi (Movistar Yamaha): 1:54.956s
3. Marc Marquez (Repsol Honda): 1:54.961s
4. Jorge Lorenzo (Ducati): 1:55.038s
5. Cal Crutchlow (LCR Honda): 1:55.055s
6. Danilo Petrucci (Alma Pramac): 1:55.203s
7. Johann Zarco (Monster Yamaha Tech 3): 1:55.221s
8. Andrea Iannone (Suzuki Ecstar): 1:55.270s
9. Alex Rins (Suzuki Ecstar): 1:55.431s
10. Dani Pedrosa (Repsol Honda): 1:55.474s