World champion Jorge Lorenzo cut Marc Marquez's lead at the top of the MotoGP standings to 34 points with victory in San Marino, his second win in a row.
The 26-year-old, who started from the front row on his Yamaha, has now won his last three races at Misano.
Fellow Spaniard Marquez took second, with Repsol Honda team-mate, and title rival, Dani Pedrosa third and Yamaha's Valentino Rossi fourth.
Britain's Cal Crutchlow finished in sixth position on his Tech 3 Yamaha.
Lorenzo insisted his title hopes were over after winning the British Grand Prix a fortnight ago, but his latest victory keeps alive his hopes of retaining the crown, with five legs of the 18-race season remaining.
He has moved into second place in the standings behind 20-year-old Marquez, and level on points with Pedrosa, but remains cautious about his title chances.
"It is important to win, but we have only recovered five points, so it is the same as Silverstone," he said. "It doesn't make a big difference to the championship.
"But I'm very happy for this victory, because we struggled a lot during the weekend, especially on braking."
Marquez, who started on pole but dropped to fourth early in the race, said: "The second place is important, especially because with the fuel tank full, I was struggling.
"I did go wide twice and that penalised me a lot in the race but we had a good race to take points for the championship. That is important."
The win, the 49th of Lorenzo's career, means the Mallorcan has triumphed at both Italian races on the calendar for three successive seasons.
From second on the grid, he took the lead as Marquez dropped to third on the opening lap.
The championship leader, who crashed in the morning warm-up, recovered to pass both Rossi and Pedrosa but, with the Honda team-mates locked in battle until the end, Lorenzo cruised to victory.
Rossi was competing on his home circuit, renamed the Misano World Circuit Marco Simoncelli in honour of his close friend, whodied following a crash at the 2011 Malaysian MotoGP.
In Moto2, Britain's Scott Redding had his lead in the standings cut to 23 points by finishing sixth.
Title rival Pol Espargaro secured victory, denying Takaaki Nakagami a career-first win by passing him on the penultimate lap.
San Marino Grand Prix result:
1 Jorge Lorenzo (Spa) Yamaha 44:05.522
2 Marc Marquez (Spa) Repsol Honda +3.379secs
3 Dani Pedrosa (Spa) Repsol Honda +7.368
4 Valentino Rossi (Ita) Yamaha +15.062
5 Stefan Bradl (Ger) LCR Honda +22.355
6 Cal Crutchlow (GB) Tech 3 Yamaha +22.599
7 Alvaro Bautista (Spa) Honda Gresini +31.059
8 Andrea Dovizioso (Ita) Ducati +42.702
9 Nicky Hayden (US) Ducati +44.858
10 Michele Pirro (Ita) Pramac Ducati +47.818