Australia have flirted with disaster but fought their way into the Women's Rugby World Cup quarter-finals, clinging on for a 13-7 victory over Wales.
Two Lori Cramer penalties proved the difference on Saturday in Whangarei, where the Wallaroos underwhelmed on their way to a tight victory.
Australia were dominant in possession but disjointed in attack, scoring just one try on 12 visits to the Welsh 22.
Running into the wind, Australia boasted a 10-7 halftime lead, with Iliseva Batibasaga's fifth-minute try cancelled out by Sioned Harries' effort.
The stage was set for the Wallaroos to run over the top of Wales, but time and again Australia turned over possession on an infuriating afternoon for coach Jay Tregonning.
Kaitlan Leaney's 70th-minute yellow card gave Wales a look at a mighty upset and their first-ever win over Australia, but the Wallaroos successfully starved them of the ball to prevail.
While the win was ugly, Grace Hamilton was immense with 16 carries, a stat she now leads at the tournament.
Boasting back-to-back victories for the first time under Tregonning, the Wallaroos stay alive in the tournament.
Captain Shannon Parry said she was "really proud of the girls today to guts out" the win.
"It's massive to be in the quarter-finals, this group has come a long way since the start of the year and that was the first box we wanted to tick," she told reporters.
Australia must now play a waiting game to learn their next opponents, with a wide range of possibilities still alive.
On another blustery day at Northland Events Centre, Wales enjoyed the wind at their back early but started flat-footed, allowing Batibasaga to steal an early lead.
The halfback looked to dish from a breakdown but found no takers, spinning 360 degrees and finding a path to the try line, running in under the posts unattended.
Cramer converted for a 7-0 lead.
Australia were dominant, enjoying 80 per cent possession up until the moment they let the Welsh back into the contest.
Four phases after a lineout - the source of four Wales tries at this tournament - Harries dived for the line and found it.
Bienne Terita's barnstorming run down the middle threatened to give the Wallaroos a second try, but they had to be content with a 10-7 lead after Cramer's late first-half penalty.
Arabella Mackenzie went over the line shortly after the break only to be denied by stoic Welsh defence.
What followed was 25 minutes of clumsy rugby with the Wallaroos flirting with disaster.
Tregonning fumed in the box, throwing his pen in frustration as opportunities passed them by.
In the 70th-minute Leaney offered Wales a pathway to victory when she shoulder-charged Alex Callender, but the Wallaroos finished the scoring through Cramer's boot in the 78th.
The win means Australia finish second in their group, losing to the hosts but also beating Scotland last weekend.