Denmark who needed to win to advance, dominated possession but were caught off guard when Australia scored the game-winning goal on the hour mark.
Mathew Leckie finished a brilliant counter-attack with a low shot past Kasper Schmeichel after Denmark lost the ball in the Australian box.
YOU MAY ALSO LIKE: Tunisia Defeated France And Still Eliminated Off World Cup
Australia finishes second in Group D with six points, trailing world champions France only on goal difference.
Denmark, meanwhile, exits Qatar 2022 with just one point from three games, finishing bottom of the group.
On Saturday, Australia will face Group C winners Argentina.