Canada’s set for a rematch with Costa Rica – and this time, there’s a spot in the FIFA U-17 World Cup on the line.

The Canadians could have won Group B and booked their place in the World Cup with a win over Panama on Thursday night. But a 1-0 loss in their final group-stage match of the CONCACAF U-17 Championship has put head coach Sean Fleming’s side into a do-or-die playoff match against the Ticos on Sunday (4 pm ET, Fox Sports 2 in US).

The loss to Panama was Canada’s first of the competition, following a draw with Mexico and wins over Haiti, St. Lucia and, yes, Costa Rica. In that first meeting, Canada overcame a 2-1 deficit to post a 3-2 victory.

On Thursday, however, Canada couldn’t find that same comeback magic. A goal from Panama’s Damaso Santos in just the ninth minute of play stood up as the winner.

That result meant Mexico – who drew Costa Rica 1-1 earlier in the day – won Group B and punched their ticket to the World Cup, to be held in Chile Oct. 17 to Nov. 8. On Wednesday, tournament hosts Honduras clinched their own berth by winning Group A.

CONCACAF’s other two World Cup representatives will be determined in Sunday’s playoff matches. In addition to Canada’s rematch with Costa Rica, the USA will get their own rematch with Jamaica, who upset the Americans 1-0 on Wednesday.

Against Panama, Fleming utilized much the same starting lineup he’d used earlier in the tournament, with one notable difference – Toronto FC Academy midfielder Aidan Daniels got his first start of the tournament in place of Harrison Paton.

Canada have qualified for the previous two U-17 World Cups.

Canada lineup vs. Panama: Luciano Trasolini (Vancouver Whitecaps FC Residency); Kadin Chung (Whitecaps Residency), Matthew Baldisimo (Whitecaps Residency), Kosovar Sadiki (Stoke City Academy), Gabriel Boakye (Toronto FC Academy); Duwayne Ewart, Munir Saleh (Whitecaps Residency), Aidan Daniels (Toronto FC Academy), Jean-Yves Ballou Tabla, Tristan Borges (Toronto FC Academy); Daniel Sagno (Whitecaps Residency)