The Danes, needing victory to progress, dominated possession but were caught out on the break when Australia scored the winner on the hour mark.
Denmark lost the ball in the Australian box and Mathew Leckie finished a brilliant counter attack with a low shot past Kasper Schmeichel.
Australia finish in second place in Group D on six points, only behind world champions France on goal difference.
Denmark meanwhile exit Qatar 2022 in disappointing fashion, with just one point from three games, sitting bottom of the group.
Australia will now play the winners of Group C – with Poland, Argentina, Saudi Arabia and Mexico all in with a chance of topping the table – on Saturday (19:00 GMT).
Dark horses bolt as Denmark exit
Denmark came into the World Cup tipped by many fans and pundits as ‘dark horses’ after their impressive run to the semi-finals of Euro 2020 and a strong Uefa Nations League campaign in which they beat France home and away.
However they have failed to impress in Qatar and go home having scored only once in three Group D games. Their attacking struggles were acknowledged by manager Kasper Hjulmand who made three changes from the defeat to France, all in attacking positions.
Martin Braithwaite, Brentford midfielder Mathias Jensen and Andreas Skov Olsen came in as Mikkel Damsgaard, Victor Nelsson and striker Andreas Cornelius dropped to the bench – but the changes made little difference.
The Danes’ best chance came through Jensen in the first half, who forced Australia captain Mat Ryan into an impressive acrobatic save after being played through by a Braithwaite flick.
However it was telling that Denmark’s most threatening attacking outlet was left back Joakim Maehle, who tested Australia with his probing runs but was not adequately supported by those further forward.
They demanded a penalty in the second half when Kasper Dolberg was hauled down in the area, however he was narrowly offside as the Danish campaign petered out.
Denmark continue their longest winless World Cup run, having failed to to earn a victory in any of their past six games in the competition, with four of them draws.