Canada fought back from a goal down to beat the Republic of Ireland 2-1 and knock the debutants out of the Women's World Cup.
Irish captain Katie McCabe scored the Republic's first World Cup goal when her superb corner flew into the net after just four minutes.
The Irish had chances to add a second against the Olympic champions, but they were undone in first-half injury time as Julia Grosso's cross took a touch off defender Megan Connolly and nestled in the bottom corner in torrential conditions.
Adriana Leon poked Canada into the lead eight minutes into the second half and, although they pressed forward, the Republic could not find the goal they needed to keep their hopes of progressing alive.
The Republic will be playing for pride against Nigeria, who face co-hosts Australia on Thursday, in their final match in Group B.
After days of sunshine, Perth was hit by torrential rain in the lead up to the match and, knowing they needed to avoid defeat to remain in contention at their first World Cup, it was the Republic who made a stunning start.
Kyra Carusa, who was causing havoc against the Canadian defenders, forced a double save by Kailen Sheridan after being played in by Lucy Quinn.
However, there was lift off in Perth from the resulting corner when captain McCabe, who came close to scoring direct from a corner in their opener with Australia, sent a delightful, curling ball over the head of Sheridan and into the net.
It sparked wild celebrations among the Irish support, who dominated the Rectangular Stadium, which was a sea of colour and noise.
Sheridan was forced into action again as she shovelled Sinead Farrelly's effort wide, but Canada should have been level, only for stretching defender Vanessa Gilles to somehow poke. over from five yards from a corner.
New Chelsea recruit Ashley Lawrence lobbed over as the rain returned, but Carusa was causing all sorts of problems at the other end and she battled her way into the area and forced a solid save from Sheridan from a tight angle.
Farrelly saw a shot blocked from another McCabe corner, but there was a sucker punch right at the end of the half when Connolly got the slightest of touches on Grosso's low delivery and Courtney Brosnan was left helpless as the ball found the bottom corner.
Despite their first-half domination, the Republic were lucky to go in level at the break as Gilles headed narrowly wide form another corner.
Katie McCabe scored a historic first World Cup goal for the Republic of IrelandCanada hit back as Olympic champions show class
Canada introduced captain and record goalscorer Christine Sinclair at the break, and Brosnan was forced into action early in the second half when she sprung to her left to push away Jordyn Huitema's powerful attempt.
Leon's well-taken effort lifted the pressure off the Canadians, holding off McCabe to poke the ball home, and the Manchester United winger saw another attempt drop wide moments later.
Sinclair, looking to become the first player to score at six World Cups, should have achieved the feat when she shot at Brosnan from close range.
But Ireland still looked dangerous and, with the crowd roaring them on, Carusa headed over after superb play by McCabe down the left.
Sinclair and Huitema both flicked straight at Brosnan as Canada looked to kill the game off, and substitute Cloe Lacasse headed narrowly wide as the stadium held its breath.
McCabe almost produced the moment of magic that the Republic required as she skipped inside a number of Canadian tackles, but her low effort was deflected wide by Lawrence, and when another mazy run followed her attempt was high and wide.
Huitema had two chances to make sure of the win, with her effort deflected wide before a header was easily plucked out of the air by Brosnan.
Substitute Lily Agg fired straight at Sheridan as the Irish gave one final push, but it wasn't to be and the debutants will head home following the end of the group stage.
Player of the match
McCabeKatie McCabe
Canada
Squad number20Player nameLacasse
Squad number17Player nameFleming
Squad number12Player nameSinclair
Squad number13Player nameSchmidt
Squad number19Player nameLeon
Squad number4Player nameZadorsky
Squad number7Player nameGrosso
Squad number10Player nameLawrence
Squad number9Player nameHuitema
Squad number3Player nameBuchanan
Squad number1Player nameSheridan
Squad number11Player nameViens
Squad number8Player nameRiviere
Squad number14Player nameGilles
Squad number2Player nameChapman
Squad number5Player nameQuinn
Republic of Ireland
Squad number11Player nameMcCabe
Squad number8Player nameLittlejohn
Squad number15Player nameQuinn
Squad number17Player nameFarrelly
Squad number1Player nameBrosnan
Squad number18Player nameCarusa
Squad number6Player nameConnolly
Squad number10Player nameO'Sullivan
Squad number5Player nameFahey
Squad number4Player nameQuinn
Squad number20Player nameSheva
Squad number13Player nameO'Gorman
Squad number12Player nameAgg
Squad number22Player nameAtkinson
Squad number19Player nameLarkin
Squad number9Player nameBarrett
Line-ups
Canada
Formation 4-2-3-1
1Sheridan
8Riviere3Buchanan14Gilles10Lawrence
5Quinn7Grosso
19Leon17Fleming9Huitema
11Viens
1Sheridan8RiviereSubstituted forChapmanat 90+4'minutes3BuchananBooked at 36minsSubstituted forZadorskyat 45'minutes14GillesBooked at 61mins10Lawrence5Quinn7GrossoSubstituted forSchmidtat 45'minutes19LeonSubstituted forLacasseat 59'minutes17Fleming9Huitema11ViensSubstituted forSinclairat 45'minutesSubstitutes
2Chapman4Zadorsky6Rose12Sinclair13Schmidt15Prince16Carle18D'Angelo20Lacasse21Awujo22Proulx23SmithIreland
Formation 3-4-3
1Brosnan
5Fahey4Quinn6Connolly
13O'Gorman10O'Sullivan8Littlejohn11McCabe
15Quinn18Carusa17Farrelly
1Brosnan5Fahey4Quinn6Connolly13O'GormanSubstituted forShevaat 58'minutes10O'Sullivan8LittlejohnSubstituted forAggat 65'minutes11McCabeBooked at 90mins15QuinnSubstituted forLarkinat 45'minutes18CarusaSubstituted forBarrettat 65'minutes17FarrellySubstituted forAtkinsonat 65'minutesSubstitutes
2O'Riordan3Mustaki7Caldwell9Barrett12Agg16Moloney19Larkin20Sheva21Grant22Atkinson23WalshReferee:Laura FortunatoAttendance:17,065Live Text
Match ends, Canada 2, Republic of Ireland 1.
Katie McCabe (Republic of Ireland) is shown the yellow card.
Second Half ends, Canada 2, Republic of Ireland 1.
Jessie Fleming (Canada) wins a free kick in the defensive half.
Foul by Lily Agg (Republic of Ireland).
Substitution, Canada. Allysha Chapman replaces Jayde Riviere because of an injury.
Delay over. They are ready to continue.
Delay in match because of an injury Jayde Riviere (Canada).
Hand ball by Izzy Atkinson (Republic of Ireland).
Attempt saved. Lily Agg (Republic of Ireland) right footed shot from outside the box is saved in the top right corner.
Attempt saved. Jordyn Huitema (Canada) header from the left side of the box is saved in the top centre of the goal. Assisted by Vanessa Gilles.
Attempt missed. Vanessa Gilles (Canada) header from the centre of the box misses to the left. Assisted by Jessie Fleming with a cross following a corner.
Attempt blocked. Jordyn Huitema (Canada) right footed shot from the centre of the box is blocked. Assisted by Christine Sinclair.
Corner, Canada. Conceded by Niamh Fahey.
Attempt blocked. Cloé Lacasse (Canada) right footed shot from outside the box is blocked. Assisted by Sophie Schmidt with a headed pass.
Jordyn Huitema (Canada) wins a free kick in the attacking half.
Foul by Lily Agg (Republic of Ireland).
Attempt missed. Katie McCabe (Republic of Ireland) left footed shot from outside the box is too high.
Jayde Riviere (Canada) wins a free kick in the defensive half.
Foul by Amber Barrett (Republic of Ireland).