Australia have pulled their Tokyo campaign from the flames with a last-ditch 27-point defeat - 96-69 - of Puerto Rico to progress to the quarter-finals.
Winless in their first two games, the Opals needed to win by 25 to sneak into the final eight.
But it looked far from likely when they conceded the first eight points of the game, trailed by one at quarter time and led by just one at halftime.
But a 51-25 second half, helped by a three-pointer and fall-away jump shot from Cayla George in the last 90 seconds, rescued the most unlikely result.
Australia led by 24 points inside the final 30 seconds and twice turned down good looks close to the basket, George eventually nailing the jump shot to put them ahead of the target for the first time.
It saved the Opals from their worst-ever Games result and kept them in the hunt for a medal ahead of a quarter-final against either Spain or the United States.
Marianna Tolo had a monumental 26 points and 17 rebounds for Australia while George added 19 points and Jenna O'Hea chimed in with 15 points including four crucial triples.
Australian Associated Press