The Olyroos' last Group C match against Egypt and destiny was in their hands.
A number of Australian players were missing because of yellow card accumulation, but a draw would be good enough to move through to the Quarter Finals.
The Pharaohs also needed a result to advance, but for Egypt it was win or bust.
Egypt came straight out of the blocks on the attack and had a few chances that they couldn't convert.
Meanwhile, Australia made a disjointed start, with their first real chance coming towards the end of the first half. Unfortunately for the Olyroos, Nicholas D'Agostino couldn't get his header on target.
The new combinations for the Olyroos were taking a while to gel.
Then in the final minute of the opening half Egypt got their first goal of the tournament.
As Australian commentator Andy Harper said the Egyptians had coughed and spluttered all night right to that moment in the shadows of half-time.
Ahmed Rayan finished the opportunity to give Egypt a 1-0 lead after a precise delivery from Ramadan Sobhy.
Graham Arnold made a couple of changes at half-time.
Daniel Arzani and Keanu Baccus entered proceedings and the Olyroos were quickly on the attack and looked a lot more like a team that was about to score.
Marco Tilio and Arzani combined to force a save from Egyptian goalkeeper Mohamed Elshenawy, who was a strong performer on the night.
Minutes later some magical feet from Arzani forced another desperate save.
Time ticked by and Egypt went within a whisker of extending their lead when an attempt rattled the woodwork, with the subsequent header at goal floating over the crossbar.
A good strike from Arzani was brilliantly tipped over the bar with ten minutes left.
Olyroos captain Thomas Deng's header off the next corner was denied with another desperate save from Elshenawy.
There was heartbreak for Australia when Egypt extended their lead in the 85th minute.
Australia pushed to reduce the arrears as the clock wound down, however desperate defending from Egypt kept the Olyroos at bay.
Following the match, Olyroos Head Coach Graham Arnold told media in Miyagi that his squad – which defeated Argentina in their opening fixture, and narrowly lost to European heavyweights Spain throughout the Group Stage – would take a lot from the tournament.
"It has been a fantastic experience and journey," Arnold said. "I am extremely proud of the players."
"These boys will go home with fantastic memories of beating Argentina and really pushing Spain the whole way.
"Did those two games take it out of us? Maybe. (But) in the past the Olympics has developed and created a lot of national team players for the Socceroos, and the reason that I took this job on was to do that.
"The most important thing was that we qualified for this tournament, which enabled these kids to continue their journey at youth national team level for another 12 months and to play in a major tournament.
"I feel that we have come away from here with much more depth for the Socceroos and couldn't be prouder of the way that our players have represented the Australian Olympic Team both on and off the pitch."
Australia's football fortunes now lie with the Matildas, who will play Great Britain in a Quarter Final on Friday in Kashima.