EAST RUTHERFORD, N.J. - Andres Guardado scored on a penalty kick in the second and final minute of stoppage time in extra time to give Mexico a 1-0 victory over Costa Rica in the CONCACAF Gold Cup quarterfinals Sunday night.

Roy Miller was whistled for a questionable foul on Oribe Peralta with the game seconds from going to penalty kicks. Guardado converted to send six-time champion Mexico to the semifinals, where it will face Panama on Wednesday night in Atlanta.

advertisement | advertise on newsday

Mexico had dominated play but was unable to score until the final moments. Angry Costa Rica fans -- heavily outnumbered by Mexico fans in the crowd of 74,187 at MetLife Stadium -- threw bottles toward the field in protest.

The Mexico-Costa Rica matchup looked like a potential final at the start of the tournament, but both teams were sluggish in the group stage to each finish second and set up the quarterfinal meeting.