Jorge Lorenzo beat his own previous Misano lap record to take pole position for MotoGP's San Marino Grand Prix, as Marc Marquez only took fifth after a crash.
Lorenzo improved on his 2016 record on his first flying lap, beating Marquez's previous top time - already the best of the weekend - by two-and-a-half tenths.
The duo stayed first and second until the mid-session lull and both returned to the track relatively early, beginning a fast lap with six minutes still on the clock.
However Lorenzo did not improve and then pitted, as Marquez's wild effort ended with a fast crash at the Turn 15 left-hander.
Marquez then sprinted back to the garage and mounted his second bike with four minutes left of the session to run, but the Honda rider could not improve his previous time.
Lorenzo on the other hand managed to lower his benchmark by a further tenth as the chequered flag fell, topping the session with a best time of 1m31.629s.
Jack Miller moved into second just as Marquez crashed and the Pramac Ducati rider kept the position to secure his second front-row start of the season.
The front row will be completed by Yamaha's Maverick Vinales, who narrowly edged out Lorenzo's Ducati team-mate Andrea Dovizioso on his last lap.
Marquez ended up fifth, ahead of Cal Crutchlow (LCR Honda), who also had a crash, and the second factory Yamaha of local favourite Valentino Rossi.
Danilo Petrucci (Pramac) was the fourth Ducati in the top eight, with Johann Zarco (Tech 3 Yamaha) and Alex Rins (Suzuki) taking ninth and 10th, ahead of the two riders to advance from Q1, Dani Pedrosa and Franco Morbidelli.
Morbidelli chose to do one run to save tyres and then failed to set a representative lap time as he crashed at Turn 4.
Honda riders Pedrosa and Morbidelli made it through Q1 at the expense of Suzuki's Andrea Iannone, who missed out on Q2 for the first time this season.
Iannone will start Sunday's race 13th, ahead of Ducati wildcard Michele Pirro, whose own chances of making it to Q2 were over after a late crash at Turn 10.
World Superbike-bound Alvaro Bautista (Nieto Ducati) will line up 15th on the grid ahead of Aleix Espargaro (Aprilia) and Bradley Smith (KTM).
Honda wildcard Stefan Bradl was 18th as Pol Espargaro, returning from injury, qualified 20th on the second KTM.
Xavier Simeon, riding the injured Tito Rabat's Ducati GP17, had a crash at Turn 16 and will start 22nd, two places ahead of fellow faller Karel Abraham.
MotoGP debutant Christophe Ponsson, riding Simeon's Avintia Ducati GP16, rounded out the order, his 1m37.180s nearly five seconds off the pace.
|2||Jack Miller||Pramac Ducati||Ducati||1m31.916s||0.287s|
|6||Cal Crutchlow||LCR Honda||Honda||1m32.025s||0.396s|
|8||Danilo Petrucci||Pramac Ducati||Ducati||1m32.136s||0.507s|
|9||Johann Zarco||Tech3 Yamaha||Yamaha||1m32.250s||0.621s|
|12||Franco Morbidelli||MVDS Honda||Honda||1m32.454s||0.825s|
|15||Alvaro Bautista||Aspar Ducati||Ducati||1m32.792s||1.163s|
|19||Takaaki Nakagami||LCR Honda||Honda||1m33.437s||1.808s|
|22||Xavier Simeon||Avintia Ducati||Ducati||1m33.705s||2.076s|
|23||Thomas Luthi||MVDS Honda||Honda||1m33.755s||2.126s|
|24||Karel Abraham||Aspar Ducati||Ducati||1m33.812s||2.183s|
|25||Hafizh Syahrin||Tech3 Yamaha||Yamaha||1m34.080s||2.451s|
|26||Christophe Ponsson||Avintia Ducati||Ducati||1m37.180s||5.551s|