Wales survived a punishing physical examination by Samoa at the Millennium Stadium - but were made to sweat profusely for a 17-13 victory.
Wing Leigh Halfpenny’s early try, Wales’ first in Cardiff since February, threatened a runaway home win.
It did not materialise, though, as Wales needed three Dan Biggar penalties and a long-range Halfpenny strike to keep the determined South Sea Islanders at bay.
Samoa, four places below Wales in the International Rugby Board world rankings, had previously beaten their hosts three times from six attempts, including twice in the Welsh capital.
London Irish centre Seilala Mapusua’s second-half interception try, plus two penalties and a conversion from fly-half Fa’atonu Fili, threatened another colossal upset.
It should have been even closer but centre Gavin Williams missed a late penalty chance from in front of the posts and then Samoa wasted a prime attacking opportunity, allowing Wales to breathe a huge sigh of relief.
Having lost to New Zealand last Saturday, Wales boss Warren Gatland wanted a result and performance to make people sit up and take notice. But a crowd of just under 59,000 almost witnessed a Wales defeat.
Halfpenny shone throughout and there were some impressive moments from 21-year-old Cardiff Blues flanker Sam Warburton, yet Wales often played too deeply and were guilty of some desperately poor handling.
Samoa only came together as a squad last weekend but finished agonisingly close to claiming one of their most famous victories.