Caitlin Foord scored on the half-hour mark against the run of play to settle Australia’s nerves after a bright start from Denmark, led principally by Pernille Harder.
“We were under a lot of pressure in that first half but we didn’t get rattled,” coach Tony Gustavsson told Optus Sport.
“The team is very mature, playing tournament football and found a way to win.”
Hayley Raso made sure of the victory with a powerful finish mid-way through the second half.
In another huge boost for the Matildas, Sam Kerr returned to playing action from a calf injury, coming off the bench for her first 10 minutes of the tournament at the end to the delight of the capacity crowd of 75,784.
Earlier in Brisbane/Meanjin, England beat Nigeria 4-2 on penalties after a tension-filled 0-0 draw, despite having a player sent off late in the contest.
In stark contrast to the blood-and-thunder start against Canada in the must-win final group game, the Matildas were nervy in the opening half hour.
Denmark, led by Harder, asked serious questions of Australia’s defence as they transitioned quickly and bullied Australia into giving the ball away.
The Matildas struggled to get Foord into the game, while Mary Fowler was offered little space to work her magic.
But on the half-hour mark they combined to create the opener.
Very much against the run of play, Fowler showed great composure in the middle to pause and release Foord down the left.
The Arsenal striker made no mistake with the opportunity that presented itself, drilling a low ball between the legs of goalkeeper Lene Christensen to send Stadium Australia wild.
That settled Australia, who dominated the remainder of the half.
The Matildas retained that level of control for the rest of the match, but never felt safe until Raso hammered home Australia’s second with 20 minutes to go and set up a quarterfinal clash with either Morocco or France in Brisbane on Saturday.abcnews