EAST RUTHERFORD, N.J. -- Mexico earned chance after chance to score against Costa Rica, but the goal that finally came might not have been so well-deserved.
Mexico won 1-0 on Sunday night in the CONCACAF Gold Cup quarterfinals on Andres Guardado's penalty kick in the final minute of extra time. Roy Miller had been whistled for a questionable foul on Oribe Peralta with the game seconds from both teams attempting penalty kicks.
Guardado converted to send six-time champion Mexico to the semifinals, where it will face Panama on Wednesday night in Atlanta.
Mexico had dominated play but couldn't put the ball into the net until the final moments, and it took the penalty kick. Angry Costa Rica fans, heavily outnumbered by Mexico's supporters in the crowd of 74,187 at MetLife Stadium, threw bottles toward the field in protest.
With Peralta leaping to try to head in a cross in front of the goal in the second minute of stoppage time, Miller appeared to make little contact with him. But assistant referee Eric Boria of the United States called it a foul.
Costa Rica coach Paulo Wanchope declined to criticize the ruling, saying, "That's football."
"We shouldn't take away from Mexico," Wanchope said. "They played a good game. They had their chances."
The Mexico-Costa Rica matchup looked like a potential final at the start of the tournament, with Costa Rica coming off a World Cup quarterfinal appearance last year. But both teams were sluggish in the group stage to each finish second and set up the quarterfinal meeting.
Costa Rica lost in the quarterfinals for the third straight Gold Cup.
Injury-plagued Mexico repeatedly broke down Costa Rica's defense to set up good looks only for shots to sail high or wide.
"That has been our main concern since the beginning of the tournament, to be effective up front," Mexico coach Miguel Herrera said. "Unfortunately we haven't been able to be as effective as we would want to."
Carlos Esquivel nearly put Mexico ahead in the 63th minute, but goalkeeper Esteban Alvarado got his fingertips on the ball while leaning the other way to deflect it off the crossbar. Alvarado had five saves.
"You have only a certain number of plays to win a game before you start suffering, and you start thinking that if you give your opponent a break, you lose," Herrera said.
Panama also went to extra time in the first game Sunday. That game made it to penalty kicks with the score tied 1-1, and Panama won 6-5.