South Korea have qualified for the quarter-final of the World Cup after beating Spain 2-1.
They travelled to Ottawa bottom of Group D knowing that only a victory, coupled with a Brazil win over second-placed Costa Rica, would see them into the last eight.
The Taegeuk Nangja got their wish, but progression looked a tall order early on as La Roja dominated the opening stages and could have gone ahead inside three minutes when Natalia Teresa Pablos Sanchon failed to find the target from close range.
Vicky Losada then tried her luck from just outside the area but her shot whistled over the crossbar - yet it proved a sign of things to come.
On 29 minutes, the Spaniards opened the scoring through Veronica Boquete, who fired past Kim Jung-mi from 12 yards following Marta Corredera's free kick.
It was the only goal in a half that saw South Korea fail to inspire much confidence that they could progress, having failed to register a single shot in 45 minutes.
Despite dominating the opening half, Spain were pegged back on 53 minutes when Cho So-hyun headed home the equaliser to get the Asian side back on level terms.
Nevertheless, it was business as usual at the other end and Boquete and Corredera both went relatively close to re-establishing the lead - the latter forcing Kim into a fine save.
The South Koreans gradually grew more resilient and took the lead on 79 minutes when Kim Soo-yun's cross-come-shot deceived goalkeeper Ainhoa Tirapu for the goal that took them into the latter stages.