(CNN) -- Spain's Dani Pedrosa kept alive his slim hopes of landing a first MotoGP title win after coming out on top in Aragon.
Pedrosa, who is 33 points behind current leader and 2010 champion Jorge Lorenzo, claimed his fourth victory of the season in stunning style.
The race was marred by a big crash when Ducati's Nicky Hayden was thrown over the top of his bike after colliding with a wall.
But after being taken to the medical centre for assessment, the 2006 world champion was given the all-clear.
Andrea Dovizioso finished third in an action-packed race, which turned in Pedrosa's favour with 17 laps remaining.
Starting behind polesitter Lorenzo, the Honda rider managed to pass his title rival and claim a vital victory.
Germany's Stefan Bradl had looked set to make his first podium until he crashed out, leaving Dovizioso to stand alongside Pedrosa and Lorenzo.
Britain's Carl Crutchlow finished fourth with Yamaha's Ben Spies in fifth and Spain's Alvaro Bautista in sixth.
Jonathan Rea came home in seventh, ahead of Valentino Rossi, Karel Abraham and Aleix Espargargo.