Bryan Ruiz's impressive header was enough as his side won 1-0 to become the first team to guarantee qualification from Group D. Costa Rica showed their 3-1 win over Uruguay was no fluke as they took the game to Italy in impressive style.
Celso Borges headed over from a corner early on, but it was Italy's Mario Balotelli who had the best of the chances in the first half-hour.
First, Andrea Pirlo's glorious ball over the top dropped perfectly for Balotelli, who controlled it with one touch and then lofted it over the on-rushing keeper Keylor Navas but it bounced well-wide. Two minutes later he was in again, this time he went for power but too close to Navas, and the Costa Rica keeper was able to claim at the second attempt.
With half-time looming, Costa Rica were denied a blatant penalty. Joel Campbell, the Arsenal striker on loan at Olympiakos, intercepted a pass, surged into the penalty box and was knocked over from behind by Giorgio Chiellini but Chilean referee Enrique Osses waved 'play on'.
Costa Rica did not let that put them off their stride however and Junior Diaz's exceptional cross from the left saw Fulham striker Ruiz, leaving his marker Chiellini in no man's land, thump a far-post header in off the crossbar. It bounced a foot over the line but goal-line technology ensured there was no travesty of justice.
Italy upped their game after the break, mounting a string of attacks, but Navas would not be beaten.
"We came in with too slow a pace," said Cesare Prandelli, the Italy coach. "Our approach was not the best."