Defender John Ruiz scored a 72nd-minute winner to give Costa Rica a 3-2 victory over Australia on Wednesday, boosting its chances of reaching the second round of the Under-20 World Cup.

Costa Rica's first victory in the tournament allowed it to jump to second place in Group C, three points behind Spain. Australia and Ecuador remain with one point each after two matches.

Striker Joel Campbell opened the scoring for Costa Rica in the 22nd minute at the Palogrande stadium. Tommy Oar equalized for Australia in the 26th, but Campbell netted again a minute later. Australia evened the match with an own goal by defender Franciso Calvo in the 64th, but Ruiz's header off a cross by Campbell gave Costa Rica the victory.

''It was a very difficult match, very intense,'' Costa Rica coach Ronald Gonzalez said.

Australia has the difficult task of trying to beat Spain on Saturday to reach the knockout stage, while Costa Rica will play Ecuador.

''We let this one get away,'' Australia's Dutch coach Jan Versleijen said. ''We will have to get a good result against Spain, there is no alternative. It's going to be hard, no doubt. Spain is the best team in the group, but we are not giving up yet.''