Flying Scotsman John McPhee delivered his best-ever Moto3 result at Motegi's MotoGP round, coming home in seventh place after fighting his way from 22nd on the grid.
The Racing Steps Foundation-backed rider made a strong start to break into the top 10 by lap five from where he worked his way up to eighth at the mid-way point to join what was to become an ultra-tight battle for fifth place as the race drew to a close.
RTG team-mate Jack Miller led the four-way fight initially leaving McPhee and San Carlo's Romano Fenati to battle it out with Ongetta Rivacold's Alexis Masbou behind.
Sandwiched in between the lead group and the Miller-led pack behind was the strung-out pair of Jonas Folger (Mapfre Aspar) and Miguel Oliveira (Mahindra) who trailed third-placed Rins by over three and 10 seconds respectively.
That left the following pack squabbling over sixth with Masbou in charge as McPhee and Miller traded places ahead of Fenati.
But with four laps to go the squabble for sixth became a fight for fifth as Rins - who looked set to take over at the top of the standings - made a rare unforced error and dropped to the back of the field and out of the points.
In the end Fenati settled the dispute for the place jumping Miller and McPhee after Masbou crashed on the final lap. The trio finished just over a tenth of a second apart 18 seconds in arrears of race-winner Marquez.