Josh Adams crossed for a Rugby World Cup hat-trick as Wales secured their place in the tournament’s knockout stages.
The wing went over for a first half brace as his side battled from an early 10-point deficit.
His third try, followed by a Liam Williams score, saw Wales secure maximum points in Oitu, but were made to dig deep against a spirited Fiji side.
Wales tie up the pool stage against Uruguay on Sunday, as they look to seal top spot in Pool D, as Australia look to capitalise on any opportunity.
The Flying Fijians exploded out of the starting blocks, as Wales struggled to cope with their deadly combination of pace, power and skills in the opening 10 minutes of action.
A close range scrum gave them an early platform, and they fed the ball down the blindside to Lyon’s Josua Tuisova, who bumped past a couple of Welsh defenders to finish impressively in the corner.
Ben Volavola couldn’t add the extras, but Wales looked to have replied instantly, capitalising on a mistake in the Fijian midfield.
George North picked up the loose possession, finding Josh Navidi in support, with the Cardiff Blues back row reaching the whitewash.
However, the TMO intervened and spotted a knock on from Hadleigh Parkes in the build-up and the try was disallowed.
John McKee’s side also had a try chalked off for Frank Lomani, after a forward pass sent the scrum half through, but once again the TMO came to haunt the Wales side as Ken Owens was sent to the sin bin for a dangerous tackle.
Fiji continued to pile the pressure and it finally paid off as they doubled their advantage, with Kini Murimurivalu forcing his way over in the corner.
It was time for Warren Gatland’s side to take control of the game, and a yellow card to lock Tevita Cavubati for a dangerous clear-out allowed them to advance into enemy territory.
After a patient build-up, Dan Biggar sent a crossfield kick out wide, and Adams was on hand to beat Volavola in the air and touch down to break his side’s deadlock.
Wales were in the ascendant, and ill discipline from the Fijians led to another sustained period of pressure in the 22.
Adams was denied his second by the smallest of margins, as his foot had grazed the white paint of the touchline before Semi Kunatani was sent to the sin bin following repeat offences.
The pressure was finally converted into points as Wales ran it through the hands, creating numbers down the left with Jonathan Davies’ pass sending Adams over for his brace.
Biggar’s successful conversions were the difference between the sides at the interval, but Wales were once again shown a yellow card, with James Davies this time sent to the sidelines for 10 minutes.
The resulting line-out saw Fiji going for the shove, and referee Jérôme Garcès ran under the sticks to award a penalty try.
Cardiff Blues academy product and current Scarlets outside half, Rhys Patchell, brought proceedings with a long range penalty but a darting break from centre Davies put Wales in the driving seat.
The Scarlets star managed to fend off the challenge of Jale Vatubua before producing an offload out of the back to Adams. The Cardiff Blues wing had plenty to do, but finished acrobatically in the corner to seal his hat-trick.
A scrappy piece of play suddenly opened space in midfield, and Gareth Davies took full of advantage, splitting the Fijian defence and feeding Liam Williams, who had enough pace to touch down and seal the bonus point for his side.
Wales ringed the changes - with Cardiff Blues duo Dillon Lewis and Tomos Williams amongst those coming on to close out the game for Gatland’s side.