Costa Rica striker Andy Herron scored a last-gasp winner to give his team an upset 2-1 win over Chile and a place in the Copa America quarter-finals in Tacna, Peru, on Tuesday.
Herron's dramatic winner in the fourth minute of injury time gave the Central Americans a third-place finish in Group C with three points and they qualified as the second best third-placed team in the three first stage groups.
Costa Rica will face Colombia in Saturday's quarter-final in Trujillo while Chile went home with one point from their three games.
Chile went ahead when central defender Rafael Olarra scored in the 39th minute, the Argentine-based player heading the ball into the net following a Luis Jimenez free kick.
The Ticos equalised when central defender Mauricio Wright scored from close range in the 59th minute after Walter Centeno broke clear on the right and crossed.