Ruiz met Junior Duiz's cross from the left with a header past keeper Gianluigi Buffon that hit the underside of the crossbar and bounced down over the line. Goalline technology confirmed the goal. It came just minutes after the Costa Ricans were denied a clear penalty following a foul on Joel Campbell.
Italy striker Mario Balotelli earlier twice wasted opportunities to break the deadlock as Costa Rica, who began their campaign with a surprise defeat of Uruguay, again showed they are not in Brazil to make up the numbers.