The Australians got off to a terrible start in Group B with a 3-0 defeat by Germany in their opening game and appeared to be heading for a second straight loss when they trailed Zambia 5-2 early in the second half in Nice.
But the Matildas came roaring back and won an 11-goal thriller thanks to Michelle Heyman's 90th-minute strike in an unforgettable match.
It was a shocking collapse by Zambia, for whom Barbra Banda opened the scoring in the first minute and went on to net a hat-trick, with Racheal Kundananji scoring twice.
Alanna Kennedy quickly cancelled out Banda's opener, only for Kundananji to restore Zambia's lead before Banda made it 3-1.
Hayley Raso pulled one back but Banda scrambled in to complete her hat-trick just before the break and make it 4-2.
Kundananji then headed in for 5-2 on 56 minutes, but defensive gifts by Zambia handed last year's World Cup semi-finalists a way back into the contest.
Lushomo Mweemba played a clearance from her own line off goalkeeper Ngambo Musole and into the net for an own goal, and the 'keeper then fumbled in a Steph Catley free-kick for 5-4.
Catley converted a penalty for 5-5 and Heyman ran through for the winner.
Record four-time gold medallists the United States take on Germany in Marseille later in the same group.
Japan late show
Spain's all-star side beat Nigeria 1-0 for their second straight victory in Group C, with former Ballon d'Or winner Alexia Putellas scoring a late free-kick to decide the game in Nantes.
The world champions are now certain to at the very least be one of the best third-placed sides and will be in the quarter-finals.
Earlier in the same group, Momoko Tanikawa scored a stunning 96th-minute winner as Japan netted twice in injury time to come from behind and beat Brazil 2-1 in Paris.
Japan, the 2012 silver medallists, were staring at a second straight defeat in Group C that would have left them in serious danger of a first-round exit after Jhennifer put Brazil ahead early in the second half.
But captain Saki Kumagai rolled in a 92nd-minute penalty to equalise at the Parc des Princes before 19-year-old substitute Tanikawa's incredible first-time shot from 30 metres sailed over the goalkeeper and in for the winner.
It was a remarkable comeback by Japan, for whom Mina Tanaka had a penalty saved in the first half with the game goalless.
The result means Japan and Brazil -- silver medallists in 2004 and 2008 -- are now level on three points after two matches.
Colombia beat New Zealand 2-0 in Lyon in Group A, in which hosts France play reigning Olympic champions Canada later.
The Canadians are in turmoil after being deducted six points on Saturday for the spying scandal which led to coach Bev Priestman being suspended for a year by FIFA.