Williams crossed for a 58th try in 87 Wales appearances with the last play of a pulsating match to ensure a fairytale ending in front of 61,000 supporters.
The 34-year-old danced over in typically clinical style, beating Berrick Barnes and Digby Ioane on his way to a score that saw everyone in the stadium up on their feet and even brought a wry smile from Wallaby fly-half James O’Connor.
Williams was understandably in tears after the final whistle as the magnitude of the moment dawned on him and the entire crowd roared their appreciation for a true servant of the national game.
“I couldn’t have scripted it better,” said Williams as he said goodbye to the Test arena in sensational style.
“I thought the opportunity to score had gone. We had an overlap on the right but we trucked it up in midfield and were given a penalty. Luckily I was then on the end of a very good pass on the outside of Berrick Barnes and the inside of Digby Ioane.
“It was a fantastic occasion for me personally and I feel privileged. There’s no better place to play than the Millennium Stadium and, because of the fans, I was balling my eyes out.
“There’s no better way to finish than in front of those supporters. From start to finish they were fantastic. The support has been unbelievable. I’ve been overwhelmed at times. I know I’m biased but that was the best atmosphere I’ve ever played in. The crowd added to all the emotion.”
Williams does have one regret from his final 80 minutes in Wales colours, though – that his swansong didn’t end in a win.
A hat-trick of Australian tries in a 10-minute period when Leigh Halfpenny was in the sin bin midway through the second half saw the game slip away from Wales.
Wales hit back with tries from Rhys Priestland and Williams but it wasn’t quite enough to see them gain revenge for defeat to the same opposition in the Bronze Medal match at the recent World Cup in New Zealand.
“I’ve got mixed emotions,” added Williams. “It couldn’t have finished better for me personally to score but it’s always nicer to score when we’re winning.
“The whole point of today was to win. It wasn’t about the emotion – it was about beating Australia. That was disappointing but it was a commendable effort against a very good Australian side. I’ve no doubt these boys with Wales are capable of big things.”