Costa Rica saved the Queen. But there was no saving England. The end of the World Cup dream has been confirmed. England needed Italy to win here in order to cling to the most slender of lifelines, yet the hope was snuffed out by Costa Rica, the tournament’s most romantic surprise. The only consolation was for Her Majesty. Mario Balotelli had demanded a kiss from her if Italy triumphed.

Costa Rica have qualified from the Group of Death that was supposed to eat them alive and nobody can say that they did not deserve it. After last Saturday’s 3-1 win over Uruguay, they went toe to toe with the four-times world champions and they were the better team.

They shrugged off the harsh decision not to award them a 43rd-minute penalty for a barge by Giorgio Chiellini on Joel Campbell to strike the decisive blow through the captain Bryan Ruiz. The Fulham forward, who spent the second half of last season on loan at PSV Eindhoven, can cherish one of the goals of his life.

Ruiz stands to begin next season in the Championship after Fulham’s relegation, but, for now, he has the more enticing prospect of a World Cup knock-out tie. Not for the first time, England have been damaged by a player with a point to prove in England. Costa Rica’s celebrations at full-time were suitably frenzied. This is only their fourth World Cup appearance and it is the second time that they have reached the last 16. In many respects, the achievement betters that of Italia 90, when they beat Scotland and Sweden at the group stage before losing to Czechoslovakia in the second round.

The smartness of their passing game, together with their organisation and commitment, has illuminated fixtures against two of the more fancied nations. They will fear nobody moving forward, least of all England, who they meet in the final group tie. Jorge Luis Pinto, the manager, even has the luxury of resting players in what has been rendered a dead rubber.

“We will try to top the group because in first place, you have certain advantages,” Pinto said. “But this is a very special moment, we have been working many years for this. We have made history for Costa Rica.” For Italy, the Uruguay game next Tuesday has become decisive. It is a winner-takes-all, although Italy do have the safety net of the draw. They will have to play a lot better than this. After the high of the performance in the 2-1 win over England and all of the positivity that they had generated, this was a crash. They were jaded, error-strewn and unimaginative. For long spells, they chased the ball.

Balotelli missed a gilt-edged chance in the first half but, that apart, they created nothing of clear-cut note. Italy have not come from behind to win a World Cup tie in 20 years and they did not look like altering the statistic. The faces of their players as they filed silently out of the stadium told the story. “I am terribly sorry, not just for the English but for ourselves,” Cesare Prandelli, the manager, said.

It might have been different had Balotelli scored in the 32nd minute from Andrea Pirlo’s whipped ball over the top that put him one on one with Keylor Navas. But the striker’s first touch was heavy and the less said about the second, the better. The attempted lob was all wrong. Moments later, Balotelli did test Navas from further out only for the goalkeeper to save.

Costa Rica had gone close with a Celso Borges header from one of Christian Bolaños’s dangerous set-pieces and Óscar Duarte went even closer with a looping back-header before the game burst to life. First, there was the injustice. Chiellini’s miscontrol allowed Campbell to burst clear and when the defender caught up, he bundled into him. The Chilean referee, Enrique Osses, was the only person inside the stadium who did not think it was a penalty.

Pinto raged and he thought about striding across the pitch to confront Osses at the half-time whistle but his staff ushered him away. By then, his team were in front. From Júnior Diaz’s left-wing cross, Ruiz got in between Chiellini and Matteo Darmian too easily to head home off the underside of the crossbar. Goal-line technology confirmed that the ball had bounced down and in.

Prandelli made attacking changes in the second-half, bringing on Antonio Cassano to support Balotelli more closely, Lorenzo Insigne on the left and Alessio Cerci on the right. Pirlo fizzed in a 52nd-minute free-kick that Navas needed to beat away but Italy laboured. They did not work Navas thereafter.

Pinto’s team carried out their game-plan to the letter. They compressed the space between the lines and whenever the ball was played up to Balotelli, one of the three central defenders, normally Giancarlo González, snapped into the challenge. Balotelli felt the frustration – every Italian did – and he was booked when he caught Diaz with his hand. It was not his day.

During the second half, there were Olés for passages of Costa Rican possession. For Pinto and his players, these were the moments that will live forever in their memories.

Campbell flickered, so did the substitute Marco Ureña late on and there were glorious snap-shots when Bolaños skipped away from a full-blooded Daniele De Rossi tackle and Ruiz tricked Insigne. The crowd loved it. England fans watched through their fingers.