Shane Williams, for once, did not mark a farewell with a try. He had done so with the Lions, Wales and, last week, for the Ospreys, when his late score secured the Pro 12 title, but he never appeared comfortable playing against the country he had won 87 caps for.

Two of Wales's three tries came after Williams had been in possession. For the first, he appeared in midfield but he was tackled before he could get into a gallop. Justin Tipuric forced the turnover and when Wales moved the ball right in their own half Harry Robinson, who was four years old when Williams made his debut in senior rugby, did not have his opposite number to worry about on a 60-metre run to the line.

Williams's final flourish as a professional saw him first caught by the second-row Ian Evans as he scented space down the left wing, having acted as scrum-half at a ruck. He hesitated slightly before setting off, allowing his fellow Osprey to collar him, and two minutes later, with time almost up and the Barbarians two points behind, Williams fielded a kick on his own 10m line and set off.

Wales, as they had done all game, closed him down quickly. A forced pass to Cedric Heymans followed and when the replacement full-back tried to move the ball on one-handed to Sailosi Tagicakibau outside him, he succeeded only in directing it into the hands of the wing Aled Brew.

Wales leave for their tour of Australia , having sent out an advance party of 16 players, armed with six consecutive victories, but they were fortunate the Barbarians had a policy of not kicking penalties. Twice, when they were 21-16 ahead in the final 12 minutes, they had the chance to put themselves two scores ahead but opted for set-pieces and lost the ball at the subsequent breakdown.

Wales had dominated the opening quarter, taking a 13-point lead, and it took the Barbarians far too long to come to terms with the predatory Tipuric. If Stephen Donald's try on 25 minutes came against the run of play, the visitors were twice denied by the video official after imposing themselves up front. They then enjoyed a man advantage after Rhys Gill was sent to the sin bin for killing the ball before going into the interval ahead through the former Wales scrum-half Richie Rees.

Wales brought on Martyn Williams six minutes into the second period for his 100th and final cap and a standing ovation but it was James Hook, starting at No12 and finishing at 10, who lifted the game beyond the unexceptional. His third penalty restored Wales's lead before Donald ran through his opposite number, Dan Biggar, from a scrum.

The far more experienced Barbarians looked in control when Wales broke out, and Hook, by now at fly-half with Biggar, one of four players in the match-day squad who will not be going to Australia, went on a weaving run to the line that left Heymans so confused he virtually tripped himself up.

It was a day for the two Williams, but ahead of three Tests it was Hook, cunning and deceptive again, having looked jaded in the World Cup, whom the Wallabies will have to catch.