Spain were eliminated from the Women's World Cup on Wednesday, after coughing up a lead to lose 2-1 to South Korea in Ottawa.
Ranked 14th in the FIFA standings, Ignacio Quereda's side needed to win their Group E finale to have any chance of progressing to the knockout phase - and were on track after Veronica Boquete scored in the 29th minute at TD Place Stadium.
But the South Koreans hit back after half-time, with Cho So-hyun and Kim Soo-yun goals sending Yoon Deuk-yeo's team from bottom of the group directly into the last 16.
South Korea will face France in the knockout stages, after the latter were resounding 5-0 winners over Mexico at the same venue.
Marie-Laure Delie set the French on their way with a goal just 34 seconds in - the second-fastest goal in the tournament's history - while they were 4-0 up after just 36 minutes courtesy of an own goal to Mexico's Jennifer Ruiz and Eugenie Le Sommer's brace.
Amandine Henry completed the scoring with 10 minutes to play.
Joining France in advancing out of Group F were both England and Colombia, the latter advancing as one of the best third-placed teams.
England defeated Colombia 2-1 in Montreal, with Karen Carney and Fara Williams goals in the first half the difference.
Lady Andrade scored deep into second-half stoppage time to mark England goalkeeper Karen Bardsley's sheet, but both sides progressed to the last 16 regardless.
England will take on Norway for a spot in the quarter-finals, while Colombia face United States.
Brazil had already secured progression to the last 16, but moved into their clash with Australia full of confidence after a 1-0 win over Costa Rica.
Raquel's 83rd-minute goal preserved the Brazilians' perfect record at the tournament, and eliminated Costa Rica.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.