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.
: 259 points
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.
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.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.