World champion Marc Marquez clinched victory in the Catalunya MotoGP for his seventh win from seven races.
The 21-year-old Spaniard started from second on the grid but overtook long-time leader Valentino Rossi of Italy with six laps to go.
Marquez battled it out with Honda team-mate Dani Pedrosa over the final couple of laps in stormy Barcelona.
But a late error by Pedrosa saw him drop to third with Rossi moving up for second, 0.512 seconds behind Marquez.
The win leaves Marquez on 175 points while Rossi remains second on 117 - five points ahead of Pedrosa.
It was the 62nd podium for Marquez and the 100th MotoGP win for Honda.
"It's so nice to win in front of my home fans," he said. "The last laps I made a comeback after nearly clashing with Valentino early in the race and felt really strong.
"It was a great tussle on the final lap first with Valentino then with Dani. This is special."
The victory completed a superb weekend for the Marquez family after younger brother Alex won the Moto3 race on a Honda.
1. Marc Marquez (Spain)Honda) 42min 56.914sec,
2. Valentino Rossi (Italy) Yamaha at 0.512sec,
3. Dani Pedrosa (Spain) Honda) 1.834,
4. Jorge Lorenzo (Spain) Yamaha 4.540,
5. Stefan Bradl (Germany) Honda 11.148
6. Aleix Espargaro (Spain) Yamaha 14.213
7. Pol Espargaro (Spain) Yamaha 16.127
8. Andrea Dovizioso (Italy) Ducati 16.175
9. Andrea Iannone (Italy) Ducati 18.040
10. Bradley Smith (GB) Yamaha 24.781
World championship standings:
1. Marc Marquez 175 pts
2. Valentino Rossi 117
3. Dani Pedrosa 112
4. Jorge Lorenzo 78
5. Andrea Dovizioso 71