Jorge Lorenzo led from start to finish to win the Spanish MotoGP ahead of double world champion Marc Marquez.
Lorenzo started from pole and edged away from Marquez, with his fellow Spaniard left to concentrate on keeping Italy's Valentino Rossi behind him.
Marquez was racing just days sustained during a crash in training.
Rossi, 36, took third to become the first man to claim 200 podium finishes and retains the championship lead.
Lorenzo, 27, earned his 34th win in the top category but his first this season, having failing to make the podium in the first three races.
The victory came after the two-time world champion had seen it confirmed he would be kept on by Yamaha for next season.
"We'll enjoy this for the moment," he said. "It was an impressive win and I felt very good on the bike.
"It is an extra special win after a long time of waiting. Today I could take advantage of my impressive pace and talent."
Marquez revealed it had been one of the most difficult races of his career.
"Yes it definitely was tough, not so much my finger but because I felt great pain in my right arm," he said.
"At one point I couldn't move my fingers so to be second here is important."
Briton Danny Kent earlier won his third Moto3 race in a row to top the standings.
Spanish Grand Prix results:
1. Jorge Lorenzo (Spain) Yamaha 44:57.246
2. Marc Marquez (Spain) Honda 45:02.822
3. Valentino Rossi (Italy) Yamaha 45:08.832
4. Cal Crutchlow (Britain) Honda 45:19.973
5. Pol Espargaro (Spain) Yamaha 45:23.866
6. Andrea Iannone (Italy) Ducati 45:24.267
7. Aleix Espargaro (Spain) Suzuki 45:32.691
8. Bradley Smith (Britain) Yamaha 45:33.542
9. Andrea Dovizioso (Italy) Ducati 45:39.179
10. Yonny Hernandez (Colombia) Ducati 45:48.318
World Championship standings:
1. Valentino Rossi (Italy) Yamaha 82 points
2. Andrea Dovizioso (Italy) Ducati 67
3. Jorge Lorenzo (Spain) Yamaha 62
4. Marc Marquez (Spain) Honda 56
5. Andrea Iannone (Italy) Ducati 50
6. Cal Crutchlow (Britain) Honda 47
7. Bradley Smith (Britain) Yamaha 36
8. Aleix Espargaro (Spain) Suzuki 31
9. Pol Espargaro (Spain) Yamaha 26
10. Maverick Vinales (Spain) Suzuki 20