Costa Rica reached the FIFA World Cup last 16 for the first time since 1990 as Bryan Ruiz's header at the end of the first half proved enough to see off Italy in Recife.
Costa Rica had largely the better of the first half at the Arena Pernambuco, and got their reward on the stroke of the interval when Fulham FC forward Ruiz headed in. Four-time champions Italy were unable to muster a response and now face a decisive fixture against Uruguay on the final day of Group D. Costa Rica's win also means England are eliminated.
Having both won their opening games, confidence was high in each team although clear chances proved hard to come by in the opening stages. Costa Rica looked dangerous from corners early on, Celso Borges heading one over the top after beating Gianluigi Buffon to the ball.
Italy took a while to stir but then threatened twice in quick succession through Mario Balotelli, the match winner against England. In the 31st minute Andrea Pirlo played a pass over the top of the defence but Balotelli could only lift a weak shot over Keylor Navas and it bounced away from danger.
The goalkeeper then blocked the striker's first-time shot from 25 metres but any thoughts of an Italian breakthrough were abruptly halted as Costa Rica ended the half on top. Ruiz's clever cross from the right was met by Oscar Duarte for a header that looped on to the roof of the net, yet moments later there was no such escape for Italy. Júnior Díaz delivered a perfect left-wing cross and Ruiz escaped his marker to power a header past Buffon and in off the underside of the crossbar.
Italy coach Cesare Prandelli introduced Antonio Cassano at half-time and his team initially showed more attacking verve, Navas keeping out a Pirlo free-kick moments after diving to his left to spectacularly touch over a Matteo Darmian drive as the left-back cut inside. That proved a false dawn, however, as Costa Rica's tireless work denied their opponents time and space and ensured they held on for a famous win, and a last-16 place for just the second time.