The Lions' next opponents scored three tries in a 10-miute period while Leigh Halfpenny was in the sin bin midway through the second half but Williams' last-gasp intervention ensured the headlines will be all his on Sunday morning.
And the 34-year-old, who took his try tally to 58 for Wales and two for the Lions, admitted his glittering career could hardly have come to a better end in front of more than 60,000 fans at the Millennium Stadium.
"I couldn't have scripted it better," said an emotional Williams as he said goodbye to the Test arena with a try and plenty of tears.
"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.
After the Wallabies had surged ahead while Halfpenny was a helpless spectator, 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."