A win, a draw, a losing bonus point (scoreline stays within 7 points or fewer), or a four-try bonus point were all the ways Fiji could make it through to the next round.
Portugal won the pool C encounter 24-23, but the losing bonus point is enough to see Fiji through.
It means Australia finishes third in the pool and are out of the World Cup.
Levani Botia and Mesake Doge scored Fiji's two tries.
Fiji will face England in the last eight.
Look back on all the action on RNZ Pacific's blog: