Great Britain women were left "devastated" after their bid for Olympic glory was ended by Australia in an agonising 4-3 defeat after extra-time.
A last-gasp equaliser and a missed penalty cost Team GB a place in the semi-finals after Ellen White's double had give them a 2-1 lead going into the final minute of normal time.
But a defensive lapse at the death allowed Sam Kerr to haul Australia level and take the match to extra-time.
Caroline Weir then missed from the spot before goals from Mary Fowler and Kerr sent the Brits spinning out, with White completing her hat-trick in vain.
"We are devastated right now. It is hard to lose a game like this," said head coach Hege Riise.
"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."
Great Britain started well and Keira Walsh crashed a shot against the post with Teagan Micah beaten but, against the run of play, Australia took the lead after 35 minutes.
Demi Stokes conceded a corner and when Arsenal's Stephanie Catley whipped the ball in Alanna Kennedy beat Leah Williamson to head in from six yards.
But White was again Team GB's hero when she levelled after 57 minutes.
The Manchester City striker latched on to Lauren Hemp's cross and glanced a fine header across Micah from eight yards.
Australia nearly regained the lead three minutes later when Steph Houghton turned the ball onto her own bar from close range.
But Great Britain went ahead when Australia failed to clear a throw-in and White reacted quickest in the box, firing first-time into the corner despite Micah getting a touch.
Hemp almost added a third with an audacious long-range lob which had Micah scrambling, but it floated just wide.
Instead, in the 89th minute Team GB hesitated fatally when the ball dropped to Kerr in the area. Nobody closed down the Chelsea forward, who had all the time in the world to steady herself before firing past Ellie Roebuck from 12 yards.
In extra-time Micah did well to tip Walsh's deflected drive over the crossbar, and from the corner pushed White's close-range effort wide.
Great Britain were gifted the chance to take the lead again nine minutes into extra-time when Nikita Parris fell under a challenge from her former Lyon team-mate Ellie Carpenter.
Weir stepped up to take the penalty but Micah saved her weak effort, diving to her left.
Moments later Team GB were stunned when Australia went ahead, a long-range shot from Fowler taking a deflection off Lucy Bronze and flying into the top corner.
Kerr made it 4-2 inside the first minute of the second half, rising above Houghton to head in off the underside of the crossbar.
White pulled one back with another header for her sixth goal of the Games with five minutes remaining, but they could not force an equaliser.
"We win and we lose together," added Riise. "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 was left to reflect on a missed opportunity. She said: "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."