Julia Grosso netted the winning penalty as Canada claimed their first-ever gold medal in football to break Sweden hearts after a dramatic shootout at Yokohama Stadium.
After 12 spot-kicks, the Canadian substitute stepped up under immense pressure and scored to ensure Bev Priestman's side prevailed following an absorbing two hours of football.
Silver medallists at Rio 2016, Sweden looked on course to go one better when they edged in front through Stina Blackstenius, who broke the deadlock 11 minutes before half-time with her fifth goal in the competition.
In her bid to get back into the game, Canada boss Bev Priestman made a double change at the break, bringing on Grosso and West Ham forward Adriana Leon.
But it was the introduction of Deanne Rose which sparked an immediate improvement, her cross finding Christine Sinclair and drawing a risky challenge from Amanda Ilestedt inside the box. After a lengthy VAR review, the penalty was given and Chelsea's Jessie Fleming coolly sent the goalkeeper the wrong way to set up a thrilling finale.
And although both sides had their moments in the closing stages of the 90 minutes, extra-time could not be prevented. There was plenty of endeavour in the final half-an-hour but fatigue had clearly set in and barring Lina Hustig's late headed opportunity, extra-time passed without incident.
But there was plenty of drama in the penalty shootout. Sweden missed four of their six penalties, with Labbe saving from Anna Anvegard and Jonna Andersson's efforts, and although Canada made hard work of it, missing three of their own, Grosso held her nerve to score the decisive spot-kick to give her side an historic victory.
TALKING POINT - Brave Canada win historic gold
When Canada fell behind, you had to fear the worst for Bev Priestman's side. There is a distinct lack of goals in this team and it was difficult to see where the equaliser was going to come from. But then in the 66th-minute, a penalty, coolly converted by Fleming. Thereafter, it was a case of digging deep and defending resiliently, just like they had done so successfully throughout the tournament. Yes, they rode their luck at times, but Canada ultimately reduced Sweden to half-chances, and when a gilt-edged opportunity fell to Lina Hustig, she was too tired to take it.
When it got to penalties, it was just a matter of who could hold their nerve. The pendulum swung one way then the other, but it was Canada who dealt with the pressure that little bit better. It's harsh on Sweden, who had the look of champions from matchday one and one has to wonder if they will ever have a better opportunity.
For Canada, they will savour every moment. After a special journey in which they defeated their rivals USA and the likes of Brazil, their reward for a spirited and inspirational run is an historic gold medal. And what's more, they more than played their part in a thrilling showpiece final - the perfect advertisement for women's football.
STAR OF THE MATCH - Ashley Lawrence (Canada)
Any one of Canada's defenders, all of whom put their bodies on the line to earn gold, could have been given the award - but Lawrence edges it. Except for missing her penalty, she never put a foot wrong all night.
Jessie Fleming #17 of Canada celebrates her goal with teammates during the Olympic women's football gold medal match between Sweden and Canada at International Stadium Yokohama on August 06, 2021 in Yokohama
Canada: Labbe 8, Chapman 7, Buchanan 7, Gilles 8, Lawrence 9, Quinn 5, Scott 8, Fleming 8, Sinclair 7, Prince 7, Beckie 5.. subs: Grosso 7, Huitema 5, Leon 7, Riviere 5, Rose 8, Zadorsky N/A.
34' - GOAL! Sweden 1-0 Canada (Stina Blackstenius): Quinn is caught on the ball in midfield, Sweden break quickly as Asllani drives up the right flank, looks up and rolls it to Blackstenius. Her first-time shot takes a nick off a defender and it finds its away past Labbe, and her fifth goal of the tournament gives Sweden the breakthrough!
66' - PENALTY! Rose makes an immediate impression, delivering a cross into the penalty area for Sinclair to contest. She's beaten to the ball by Ilestedt, but is that a foul inside the box? Initially the referee allows play to continue, but the officials are going to check this with VAR. This is a big moment in the game! After having a look at the pitchside monitor the referee then points to the spot! Canada have a glorious chance to level the scores!
67' - GOAL! Sweden 1-1 Canada (Jessie Fleming, pen): As cool as you like, Fleming steps up and sends the goalkeeper the wrong way. This sets us up for an intriguing finale!
119' - Chance! That could have been the moment! Hurtig is left all alone inside the penalty area but she somehow heads wide from Segar's cross. She has her head in her hands and understandably so.
Winning penalty! Sweden 2-3 Canada - Canada win gold! The goalkeeper gets her hand to it but she can't keep out Grosso's penalty! Canada have won gold!
Watch every unmissable moment live from Tokyo 2020 across Eurosport, Eurosport app and discovery+. Download the Eurosport app for iOS and Android now.