Costa Rica's Freddy Fernandez, right, fights for the ball with Canada's Simeon Jackson in the first period during a CONCACAF Gold Cup soccer match in Miami on Friday. ((Wilfredo Lee/Associated Press))

Already assured a berth in the Gold Cup quarter-finals, Canada played to a draw with Costa Rica on Friday to finish first place in their group.

Patrice Bernier and Marcel De Jong scored for Canada in the 2-2 result in Group A action in Miami.

Canada (2-0-1) will play its quarter-final match on July 18 in Philadelphia, with their opponent from Group B to be determined on Saturday in Foxboro, Mass.

Group A standings

Team Wins Losses Draws  Points 
Canada  1 7
Costa Rica 1 4
Jamaica 2
El Salvador 1 3

The draw between Panama and Mexico on Thursday had already officially sent Canada through to the next round, but the Canadians didn't rest on their laurels.

"I thought the guys played their hearts out," Canada defender Andrew Hainault said. "We're happy with the result. To come out first in the group, nobody expected us to do this."

The scoring in the match held at Florida International University Stadium came within a 12-minute span in the first half.

Andy Herron put Costa Rica ahead in the 22nd minute, lifting the ball over keeper Greg Sutton, but Canada responded with two goals in three minutes.

Bernier took a cross in the air from Josh Simpson to beat keeper Ricardo Gonzalez in the 24th minute, with Marcel De Jong following up with a forceful left-footed volley from outside the box to put Canada ahead 2-1.

The lead was short-lived as Walter Centeno got the equalizer past a Canadian wall and Sutton on a free kick in the 34th minute.

"It was a well-played match," Costa Rica coach Rodrigo Kenton said. "We got careless for a 10-minute period, but overall, both teams played well.

"Congratulations to Canada."

Costa Rica could only watch and wait but got the desired result in the second game of the night when Omar Cummings scored for Jamaica in the 69th minute in a 1-0 victory over El Salvador 1-0.

As a result, Costa Rica finished second in Group A and also advanced to the next round.

With files from The Associated Press