But Australia hit back straight after the re-start through Lewis Holland who bagged a brace and when James Stannard added the extras for the second time the Aussies were just three minutes away from a victory.
But Wales secured possession and scored a try in the last minute when Cory Allen skirted the touchline to evade the last line of defence to get his side out of jail.
With Argentina blasting aside South Africa 21-0, Pool A is now wide open with Wales facing the Pumas first up tomorrow before taking on the Blitzbokke in the last match of the day.
Wales victory was built on stifling defence where captain Adam Thomas and Cory Allen led the way with some real rib tickling tackles.
Patience proved a virtue with Williams' opening try coming after a breath-taking period of three minutes where both teams threw the kitchen sink at each other. Eventually the Llanelli terrier spotted a gap and ran 50m unopposed to break the deadlock.
Rhys Jones' kick-offs also proved a potent weapon with his towering bombs exploding on unsuspecting receivers as tacklers arrived at the same time as the ball.
A delighted head coach, Paul John, said: "I'm really pleased for the boys, they dug in and showed a lot of resolve to beat Australia. They didn't panic and stuck to the game plan and were rewarded with a last gasp win. We need to build on the win now but we face two really difficult games tomorrow."
Wales squad for Hong Kong: Adam Thomas (Capt), Jason Harries, Craig Price, Sam Cross, Richard Smith, Alex Walker, Rhys Jones, Lee Williams, Cory Allan, Jack Phillips (Blues Academy).