Denmark were better in the first half, but couldn't find a hole in Australia.
They had to win to advance from the group stage in Qatar.
In the second half Australia were more lively and in the 60th minute the goal came through a fine solo performance by Mathew Leckie.
It was the only goal of the match and at the end joyous chaos erupted among the Australian players and supporters.
The last time they progressed from the group was in 2006.
Australia's victory means that they finished second in the group behind France and thus have to face a team from the group with Poland, Argentina, Saudi Arabia and Mexico in the round of 16.
For the Danes, the Qatar World Cup must be seen as a real failure as they went all the way to the semi-finals in the EC as recently as last year.
Before the WC, they were in tenth place in the world ranking.