Francesco Bagnaia retook the Moto2 standings lead after pipping Miguel Oliveira in a thrilling last-lap battle for victory in the Austrian Grand Prix.
Bagnaia got the best initial launch from pole position, but bogged down on the run up into Turn 1 and allowed Oliveira into the lead, while the Italian was lucky to survive contact with Fabio Quartararo.
Oliveira used the the collision behind to bolt, opening up a gap of half a second, which he quickly opened up to close to second.
Bagnaia shadowed Jorge Navarro for the first few laps, and dispatched him with a move on the inside of Turn 9 at the end of the fifth tour.
The Sky VR46 rider then set about closing Oliveira down, and had reduced the KTM man's lead down to just sixth tenths by lap 10.
The gap had reduced further on the next lap, but Oliveira held firm in the lead into the closing stages, while Luca Marini brushed off a one-place penalty for exceeding track limits to head the battle for the final podium spot with five laps remaining.
Bagnaia launched his first assault for the lead with five laps remaining at the final two corners, but Oliveira immediately struck back.
The Italian made another attempt into the first turn, though once again ran wide at allowed Oliveira back in front.
Bagnaia repeated his bid into the final turns on the penultimate lap, but Oliveira held the lead as the pair started the final lap.
Bagnaia carved past into Turn 9 on the final tour, Oliveira struck back at the last turn, but ran out wide and allowed Bagnaia to steal the win by just two tenths to take a three-point lead in the standings.
Alex Marquez took third away from Marini at Turn 3 on the last lap, but crashed at the final corner, allowing Marini back into third, while Mattia Pasini and Navarro completed the top five.
Brad Binder ran inside the podium battle in the second half, but was forced to drop out of contention for exceeding track limits late on and had to settle for sixth. Marcel Schrotter headed Joan Mir, who started 20th, the Quartararo and Iker Lecuona to round out the top 10.
Lecuona was lucky to stay upright after Lorenzo Baldassarri hit him as he attempted a move at Turn 3 early on. Baldassarri went down, his errant Pons bike collecting Simone Corsi, while Augusto Fernandez was launched into the air by his teammate's stricken machine.
Baldassarri was able to rejoin and was 26th, while Sam Lowes, Remy Gardner and Federico Fuligni added their names to the list of retirements.