It was a very steep learning curve for an inexperienced Canadian women’s team at the Pan American Games on Wednesday night, as Costa Rica scored a historic 2-0 upset victory.

It was the first time Costa Rica has ever defeated Canada in senior women’s soccer, although the Canadian side was an experimental one. With goalkeeper Stephanie Labbé, defender Kadeisha Buchanan and midfielder Ashley Lawrence all unavailable, Canada made six changes to its starting lineup from its tournament-opening 5-2 win over Ecuador.

TO2015 athletes & bios

Canada's Nkemjika Ezurike (12) and Costa Rica's Shirley Cruz (10) at Pan Am Games soccer action on Wednesday, July 15, 2015.

Canada’s Nkemjika Ezurike (12) and Costa Rica’s Shirley Cruz (10) at Pan Am Games soccer action on Wednesday, July 15, 2015.

Four players—goalkeeper Kailden Sheridan, 19, defender Victoria Pickett, 19, midfielder Sarah Stratigakis, 16, and striker Gabrielle Carle, 17—were making their first-ever starts for the senior Canadian team. In all, Canada had seven teenagers and two 20-year-olds in its starting lineup, as the team is using TO2015 as a testing ground for its next generation of talent.

RELATED: Canada men – v. Brazil
RELATED: Canada women – v. Ecuador 

On the other hand, 17 of the 18 players on Costa Rica’s roster (including all 11 starters against Canada) were at last month’s FIFA Women’s World Cup.

There was little rhythm on display by either team in the first half. The Canadians looked comfortable in front of a supportive home crowd in Hamilton, but neither side produced many quality goal-scoring opportunities.

Costa Rica players celebrate a goal against Canada in women's Pan Am Games football on July 15, 2015.

Costa Rica players celebrate a goal against Canada in women’s Pan Am Games football on July 15, 2015.

Striker Janine Beckie, who scored twice against Ecuador, had Canada’s best chance of the first half. In the 27th minute, she received a cross right in front of the Costa Rican goal, but had to reach behind her to get a foot on it, and chipped the ball over the net.

Costa Rica broke the deadlock in the second half, with captain Shirley Cruz doing well to get between three Canadian defenders and head home a corner kick in the 60th minute. Then, 14 minutes later, substitute Karla Villalobos received a long pass behind the Canadian defence and slotted the ball past Sheridan to make it 2-0.

Marie Levasseur, who came on as a substitute, had two excellent opportunities for Canada late in the game. In the 79th minute, the 18-year-old striker had a long-range shot parried over the net by Costa Rican goalkeeper Dinnia Diaz. Three minutes later, Levasseur had a one-on-one with Diaz, but chipped the ball off the crossbar.

Canada's Maria Levasseur (left) against Costa Rica in Pan Am Games women's football on July 15, 2015.

Canada’s Maria Levasseur (left) against Costa Rica in Pan Am Games women’s football on July 15, 2015.

Canada finishes off play in Group B on Sunday against Brazil, who have already beaten Costa Rica 3-0 and Ecuador 7-1. Only the top two teams in the group will advance to the semifinals and have a chance to play for a medal, meaning Canada will likely need a win to advance.

RELATED: Buchanan among young stars leading Canada

The team will be bolstered by the returns of Labbé, Buchanan and Lawrence, but will also need to take some important lessons from the Costa Rica game if they have designs on reaching the Pan Am podium.