South Korea benefited from a terrible late error by Spanish goalkeeper Ainhoa Tirapu to grab a win in their women's World Cup Group E game on Wednesday and secure a second round game against France.

Tirapu somehow allowed a looping cross from defender Kim Soo-yun to sail over her head and into the net in the 78th minute, ensuring South Korea qualified in second place with four points.

Leaders Brazil won all their three games after Raquel Fernandes dos Santos scored the decisive goal as they beat Costa Rica 1-0.

Veronica Boquete had given Spain the lead in the first half in the clash with South Korea

South Korea hit back through Cho So-hyun in the 53th minute at Lansdowne Stadium

The win means South Korea have made it out of the group stage at the World Cup for the first time. They were eliminated at the first hurdle in their only other appearance in 2003.

South Korea, who started the day in bottom place, fell behind in the first half but tied the game in the 53rd minute when Cho So-hyun planted a header into the net from close range.

Veronica Boquete opened the scoring for Spain in the 29th minute, neatly converting a left-wing cross from 12 yards out.