Reigning champion Jorge Lorenzo ended Casey Stoner's winning streak with a dominant MotoGP victory in Misano.
Stoner had won the previous three races but could only finish third, with Dani Pedrosa second.
Lorenzo took the lead at the first corner and held on to cut Stoner's championship lead to 35 points.
Lorenzo told BBC Sport: "I really needed this victory. The last two races were a nightmare for me but this gets us back on track."
Italian Marco Simoncelli finished fourth, while Briton Cal Crutchlow came home in 10th.
- Casey Stoner
: 259 points
- Jorge Lorenzo
- Andrea Dovizioso
- Dani Pedrosa
- Ben Spies
- Valentino Rossi
led the Moto2 race from the start but had to settle for fifth ahead of fellow Briton Bradley Smith, while Nicolas Terol stole the 125cc win on the line as Johann Zarco bizarrely looked over his shoulder.
There was rain in the air as the riders set off on the warm-up lap for the main event, but the bikes started on slick tyres as Lorenzo stole the lead into turn one with a bold move on Stoner.
Stoner was stalking Lorenzo but the Spaniard set a new lap record on lap 13 as he made a break to open up a lead of over three seconds.
Pedrosa closed in on team-mate Stoner and took second spot with six laps to go. The Repsol team had already said they would not implement team orders to help Stoner win the title this year.
the punishing race schedule
played its part in his lack of pace.
Lorenzo delighted with San Marino victory (UK users only)
He told BBC Sport: "Everything felt pretty good, I didn't want to push too hard when it was raining so I felt comfortable sitting behind Jorge.
"But when I started to push on I felt tired. My arms were tired and I couldn't push hard enough on the brakes.
"No excuses, I'm just worn out from the last three races. I've not slept well all week after travelling from Indianapolis."
Simoncelli was able to see off a thrilling fight from Andrea Dovizioso and Ben Spies to claim fourth as Lorenzo eased to win by 7.299 seconds.
Meanwhile The Indianapolis Motor Speedway will continue to host a round of the MotoGP championship until at least 2014, series promoters Dorna said on Sunday.
There were fears after last month's race at the Brickyard that MotoGP was set to leave the home of American motor sport after agreeing deals with California's Laguna Seca and the new Circuit of the Americas in Austin, Texas.
Dorna said in a statement that they had agreed a contract extension for three more years after talks with Indianapolis Motor Speedway CEO Jeff Belskus at the San Marino Grand Prix.
Misano MotoGP result:
1. Jorge Lorenzo (Spn) Yamaha 44'11.877
2. Dani Pedrosa (Spn) Repsol Honda 44'19.176
3. Casey Stoner (Aus) Repsol Honda 44'23.844
4. Marco Simoncelli (Ita) Gresini Honda 44'29.230
5. Andrea Dovizioso (Ita) Repsol Honda 44'29.267
6. Ben Spies (USA) Yamaha 44'29.969
7. Valentino Rossi (Ita) Ducati 44'35.580
8. Alvaro Bautista (Spn) Suzuki 44'42.555
9. Hector Barbera (Spn) Aspar Ducati 44'49.597
10. Cal Crutchlow (GBR) Tech 3 Yamaha 44'49.597
Moto2 race result:
1. Marc Marquez (Spn) Suter 43'08.197
2. Stefan Bradl (Ger) Kalex 43'08.816
3. Andrea Iannone (Ita) Suter 43'08.910
4. Alex De Angelis (RSM) Motobi 43'09.831
5. Scott Redding (GBR) Suter 43'11.472
6. Bradley Smith (GBR) Tech 3 43'11.633
125cc race result:
1. Nicolas Terol (Spn) Aprilia 40'02.164
2. Johann Zarco (Fra) Derbi 40'02.186
3. Efren Vazquez (Spn) Derbi 40'07.096
4. Sandro Cortese (Ger) Aprilia 40'11.486
5. Hector Faubel (Spn) Aprilia 40'12.128
6. Danny Kent (GBR) Aprilia 40'14.264