Isaac Vinales had a confident session after announcing his move to Gresini for next season and ended up sealing eighth on the grid for Ongetta-Centro Seta.
Alex Marquez suffered an early crash eight minutes into the action but returned to take ninth for the Estrella Galicia team.
Championship leader Luis Salom seemed cautious after landing on his already injured ankle in a Friday fall. The Spaniard went on to set his fastest lap of the weekend and pushed late on but could only muster a fourth row start taking tenth place for the Red Bull KTM Ajo outfit.
British rider John McPhee qualified in 17th after following Rins on a fast lap in the closing minutes, pulling him up from 31st position.
All eyes were on Twelve Racing wild-card Luca Marini - half-brother to multiple title winner Valentino Rossi- who qualifies in 29th on his World Championship debut.
Niklas Ajo missed the all but the last two minutes of the session after a crash at the start of FP3, which he originally was reported to have walked away from with no issues, as he underwent checks in hospital. His CT scan confirmed no damage so he returned to qualify in 21st after just one lap, his quicker lap being cancelled.