Enea Bastianini won the Aragon MotoGP with a last lap overtake after drama at the start as world champion Fabio Quartararo crashed out.
Bastianini shaded Francesco Bagnaia after a nerve-jangling duel over the closing laps to deny the factory Ducati rider a fifth straight win by four-tenths of a second
With Quartararo the victim of first lap mayhem Bagnaia moved to within 10 points of Yamaha's defending champion with five races remaining.
Aprilia's Aleix Espargaro took third at the end of a breathless 15th round of the championship which saw six-time world champion Marc Marquez's hopes of a dream return after 112 days out turn into a nightmare.
It was Marquez's Honda that Quartararo clipped, sending the hapless Frenchman slithering across the track.
Seconds later Honda's Japanese rider Takaaki Nakagami also hit the deck, after contact again with Marquez, who was forced to retire with damage to his bike.
Marquez was back for the first time since the Italian MotoGP after further surgery on the right arm he injured in 2020, was forced to retire with damage to his bike.