GB Women were agonisingly beaten 4-3 after extra-time by Australia in an epic Olympics quarter-final that had everything on Friday.
Ellen White scored a hat-trick as GB Women were denied victory one minute from the end of normal time, as well as missing an extra-time penalty to make it 3-2, as Sam Kerr's double sent Australia through to their first Olympic semi-final.
GB Women hit the woodwork three times inside 25 minutes through Keira Walsh, Rachel Daly and Lauren Hemp, but Australia took the lead against the run of play through Allana Kennedy's header from a Stephanie Catley corner (35).
But White turned it around for GB in the second half, first directing a superb header into the far corner from Hemp's cross (57), before pouncing on some poor Australia defending to snatch a second (65).
Chelsea's Kerr levelled late on having been afforded too much room in the box (89) to force extra-time, before a chaotic three minutes in which Caroline Weir saw her penalty saved by Teagan Micah (101) and sub Mary Fowler go up the other end and score with a deflected effort (103).
Kerr made it 4-2 with a fine header (106) to become the joint-record scorer for the Matildas with 47 goals, and despite White's glancing header for her hat-trick (115), Australia held on for a last-four spot, where they will face either Sweden or Japan in the semi-finals on Monday.
GB Women XI: Roebuck, Bronze, Houghton, Williamson, Stokes, Walsh, Weir, Daly, Little, Hemp, White
Subs on: Stanway, Kirby, Parris, Scott, Bright, Ingle
Timeline of drama in Tokyo
15 and 24 mins: GB Women hit the woodwork on three separate occasions through Walsh, Daly and Hemp
35: Kennedy gives Australia lead against run of play
57: White header brings GB level
65: White pounces to make it 2-1
89: Kerr afforded too much room to take it to extra-time
101: Micah saves Weir penalty after Parris was fouled
103: Fowler's deflected effort makes it 3-2
106: Kerr header gives Australia two-goal cushion
115: White completes hat-trick, but it's not enough...
How Australia edged GB Women in memorable clash
With both sides looking to reach the last four for the first time, it was GB Women who started the brighter in an eventful first 45 minutes.
Walsh was the first to hit the woodwork, seeing her low, 20-yard effort bounce back off the foot of the post with Micah beaten. Moments later, Daly's cross on the stretch looped over Micah, came back off the crossbar and fell kindly to Hemp, but her effort was parried onto the post by the busy Australian goalkeeper.
Australia then took the lead after good work from Kerr earned them a corner; Arsenal midfielder Catley delivered, and former Spurs defender Kennedy got above Demi Stokes to head superbly past Ellie Roebuck.
Australia looked the more likely to score after the break - Hayley Raso's cross found an unmarked Kyah Simon, but her header into the ground was straight at Roebuck.
In truth, GB's equaliser was also against the run of play as White, who was quiet in the game up to that point, showed her deadly instincts. Rising to meet Hemp's right-wing cross, White turned home a brilliant header from 12 yards into the far corner.
And White continued her brilliant Olympic Games record just eight minutes later, reacting to a mix-up between Kennedy and Aivi Luik in the Australia box to find the bottom right corner with her effort, despite Micah getting a strong hand to it.
As the second half wore on, GB sat deeper and deeper, and were punished as Kerr found acres of space in the box from a long Kennedy ball, taking the ball down before striking low into the net.
Extra-time was every bit as dramatic as GB Women were awarded a contentious penalty; sub Nikita Parris went down under the challenge of Ellie Carpenter, but Weir saw her penalty saved by Micah.
Two minutes later Australia were ahead as sub Fowler's long-range effort took a wicked deflection off Lucy Bronze and flew into the top corner, before Kerr netted again, getting in front of Steph Houghton to head Tameka Yallop's cross in off the underside of the crossbar.
White took her tally to six goals from four games at the Olympics to make for a nervy finish, glancing Fran Kirby's cross over Micah, but Australia held on for victory in a memorable, end-to-end contest in Tokyo.
Riise: We are devastated
GB head coach Hege Riise:
"We are devastated right now. It is hard to lose a game like this. We were well prepared. I think we played most of the game quite well. We created a lot of chances, probably should have finished a few of them. Now it's quite hard. We are all devastated.
"We win and we lose together. So there is no one to blame. We stood up and we fight together and it wasn't enough from any of us. So we are disappointed that we couldn't get the fourth goal and take it to penalties."
Defender Leah Williamson:
"It's hard because this team isn't a permanent thing. We come together once every Olympics if we're lucky. Everyone takes so much pride in that.
"I'll take so much pride forever that I was able to put on that shirt and play for this team as I'm sure the others are too. You have to take all of that.
"But we didn't just want to come here and celebrate being Olympians. We wanted to win."
Canada, Sweden, USA through to semis
Canada reached the semi-finals for the third consecutive Olympic Games as goalkeeper Stephanie Labbe saved two Brazil penalties in a 4-3 shootout win on Friday.
After Canada captain Christine Sinclair's penalty was saved by Barbara, Labbe rescued her side with two diving saves to keep out Brazil's final two spot kicks from Andressa and Rafaelle.
Labbe, who made four crucial saves in a goalless 120 minutes at Miyagi Stadium, did well to stay on the field after falling hard at the end of the second half of extra time.
The Rosengard goalkeeper's heroic efforts ensured Brazil were denied another crack at the gold medal, having claimed silver in 2004 and 2008.
Elsewhere, Japan's hopes came to an end after falling to a 3-1 defeat to Sweden. Australia now await the Swedes, who took the lead when Rolfo Fridolina's cross saw Magdalena Eriksson rise highest to head home.
Japan, who qualified for the quarter-finals as one of the two best third-placed teams, equalised when Mina Tanaka slotted home from close range.
Sweden regained the lead in the 53rd minute when Stina Blackstenius collected another Fridolina pass to convert and Kosovare Asllani's composed penalty completed the win.
In the other quarter-final, USA overcame the Netherlands in a dramatic penalty shootout following a 2-2 draw at the International Stadium Yokohama.
Megan Rapinoe struck the winning penalty after Vivianne Miedema had netted her ninth and 10th goals of the tournament in normal time - an Olympic record - either side of Sam Mewis and Lynn Williams efforts for USA.
Goalkeeper Alyssa Naeher then stopped Meidema's opening attempt in the shootout before saving from Aniek Nouwen as Rapinoe put away her winning penalty.
Monday August 2
Semi-final 1: USA vs Canada - Kick-off 9am (Kashima Stadium, Kashima)
Semi-final 2: Australia vs Sweden - Kick-off 12pm (International Stadium Yokohama, Yokohama)