A late try from former Dragon Taulupe Faletau secured Wales a potentially crucial try bonus-point as they maintained their unbeaten start to this World Cup.
But Warren Gatland’s team - that included Rio Dyer, Dan Lydiate and Taine Basham - had to graft every inch of the way before quenching the fire of a Portugal side who gave an excellent account of themselves at Stade de Nice.
First-half touchdowns from Louis Rees-Zammit and Dewi Lake had been followed up by a five-pointer for Jac Morgan.
But with Os Lobos stubbornly refusing to wilt, Wales looked in serious danger of missing out on a fourth touchdown and with it the extra point.
But then Faletau took charge with the clock deep in the red. Picking up off a scrum five metres out, the No 8 battered his way through three players to make the touchdown.
Wales next in action against Australia on Sunday (September 24) with an 8pm kick-off.