A packed Millennium Stadium crowd, still relishing the memory of a first win over New Zealand in 73 years, was in full voice throughout but silenced at full-time as Wales fell to a seventh loss in 12 tests this year.
Tries from Taniela Tupou and Brandon Paenga-Amosa gave Australia a 12-7 lead at half-time, and Max Jorgensen and Len Ikitau crossed after the break as the Wallabies snapped a four-match losing streak.
The win sent Australia above Argentina into third place in the Southern Hemisphere standings, and they will play Ireland at Twickenham next Saturday.
Wales finished fifth in the Northern Hemisphere standings and will play Japan in the play-off for ninth place in London on Saturday.
The home side were held up over the line twice before skipper Dewi Lake scored two tries off the back of rolling mauls either side of half-time.
Wales showcased brilliant backline skills to send full-back Blair Murray over for a try in the 55th minute that briefly put them in front at 21-19.
The Wallabies had an Allan Alaalatoa try scratched off for a knock-on around the hour mark, but centre Ikitau went over in the 64th minute on the back of 24 attacking phases.
Australia fly-half Carter Gordon slotted a penalty in the 74th minute to give the Wallabies a 29-21 lead, which proved enough for victory despite Wales securing a fourth try through replacement hooker Ryan Elias two minutes from time.
Wales battled for the winning score in the last few minutes, but their attempt to go the length of the field was ended when the ball was knocked on.
