Dani Pedrosa surged to his first MotoGP win of the season in wet conditions at Motegi, as Valentino Rossi beat title rival Jorge Lorenzo to a crucial second place.
Repsol Honda rider Pedrosa topped a rain-affected morning warm-up session, but initially appeared no threat to the Yamaha duo of Rossi and Lorenzo in the opening half of the race.
Poleman Lorenzo briefly lost the lead to Rossi at the first corner, but seized the advantage back at Turn 3 and wasted no time in building a gap over the championship leader.
After two laps, Lorenzo had put 1.8 seconds between himself and Rossi, and by lap five the gap between the pair was up to three seconds, where it would more or less remain until half distance.
But both Yamaha riders appeared to be struggling with front tyre wear as the track began to dry out, allowing Pedrosa, who had passed Andrea Dovizioso's Ducati for third, into the frame.
He began to lap a second faster than Rossi, who had no response for the Spaniard when he arrived on his rear wheel with nine laps remaining.
Pedrosa then wasted no time in reeling in Lorenzo, reducing the leader's three-second advantage in the space of two laps and moving into the lead at Turn 11.
It was Pedrosa's 27th MotoGP victory and his first since Brno in 2014, extending his record of winning at least one race in every season of his premier class career.
"It was not like I expected, because I lost a lot [of ground] at the beginning and I had no feeling with the rear," said Pedrosa.
"Then little by little I kept my rhythm when the other riders were burning their tyres, and my pace was faster, so I could win."
Lorenzo then began to lose time to Rossi, conceding second place and vital ground in the championship after running wide at Turn 3 with five laps to go.
"At the beginning Jorge was faster than me, but then our pace was the same," said Rossi. "Then the tyre was finished and the bike became difficult to control, but I saw Jorge slowing down."
The result is that Rossi extends his championship lead over Lorenzo from 14 to 18 points with three rounds remaining as he bids to secure his eighth premier class championship.
"It's a real pity, because if the track didn't dry out I would have won," lamented Lorenzo.
"Pushing so hard at the beginning made my front tyre worse than Dani and Valentino, and then when the line was dry I couldn't follow them."
Marc Marquez, struggling for pace with his broken finger, overhauled Dovizioso late on for fourth place, with Cal Crutchlow (LCR Honda) coming out on top in a fierce battle with Bradley Smith (Tech 3 Yamaha) for sixth.
Yamaha wildcard Katsuyuki Nakasuga, riding a 2016-spec Yamaha M1, took a creditable eighth, ahead of top Open class rider Hector Barbera (Avintia Ducati) and Scott Redding (Marc VDS Honda).
Suzuki rider Aleix Espargaro had been running as high as sixth before losing ground by running wide into the gravel, recovering to 11th ahead of MotoGP debutant and Honda wildcard Takumi Takahashi.
The tricky conditions caught out several riders, including Silverstone wet weather ace Danilo Petrucci (Pramac Ducati), Maverick Vinales (Suzuki) and Pol Espargaro (Tech 3 Yamaha), all of whom were running inside the top 10 at the time of their respective crashes.
Jack Miller was also the top Open rider early on before crashing his LCR Honda, while Andrea Iannone was forced to retire his Ducati with a mechanical problem while running seventh.
Japanese Grand Prix race results: