Costa Rica made history by reaching their first World Cup quarter-final at Greece’s expense, though it was the way they did it that will live long in the memory, surviving half an hour of extra-time with 10 men before going on to prosper in the penalty shootout.

When Sokratis Papastathopoulos equalised in the 91st minute it appeared Costa Rica were going to suffer the same fate as their Concacaf neighbours, Mexico. Greece’s late goal took the game into extra-time and, after losing Óscar Duarte to a second yellow card midway through the second half, Costa Rica looked to have little chance of survival.

Yet somehow they did, even managing a few enterprising moments of their own through José Miguel Cubero and Randall Brenes. The Greeks were scandalously wasteful of some huge overlaps and promising positions in the second period of extra-time and Kostas Mitroglou saw a shot saved right at the end when he appeared more likely to score. Thus reprieved, Costa Rica completed a perfect set of penalties, scoring all five, with Michael Umaña hitting the winning shot after Theo Gekas saw his effort, Greece’s fourth, saved by Keylor Navas. The goalkeeper, without whom Costa Rica might not have seen extra-time, let alone penalties, dived to his right but beat away Gekas’s shot with his left hand. It was a remarkable conclusion to a dramatic evening. Few World Cup victories can have been achieved against such odds. Costa Rica advance to play Holland in Salvador on Saturday, assuming they have any energy left.

While not quite as draining as the conditions in Fortaleza for Holland-Mexico, which kicked off four hours earlier in the heat of the afternoon, it was still a sultry evening at the Pernambuco Arena. The pace of the game was predictably slow, with both sides playing conservatively at first, though of course Greece always play conservatively. Invited to come forward Costa Rica gradually felt their way into the match, moving the ball around neatly and proving capable of turning past defenders, though when Cristian Gamboa had an early sight of goal he put his effort well wide.

Greece’s only goal attempt by the mid-point of the first half had been a Papastathopoulos header from a corner that missed by a distance and, though Giorgos Karagounis produced a shot on target just before the half-hour it was a hopeful effort from distance and an easy save for Navas. Their only attacking tactic appeared to be long balls towards Giorgos Samaras, which was reasonable when they were reaching the striker but questionable when he stopped running for them. Costa Rica came up with their share of overhit passes too in an uneventful and unexciting first half and it was necessary to keep reminding oneself that one of these teams had knocked out Ivory Coast while the other had inflicted unexpected defeats on Uruguay and Italy.

When something notable finally happened, eight minutes before the interval, Costa Rica were indebted to their goalkeeper for a reaction save to keep out a goalbound effort from Dimitris Salpingidis. José Holebas had opened up Costa Rica with a great cross from the left wing and when Salpingidis nipped ahead of his marker to meet it at the far post a goal seemed certain, yet Navas stuck out a leg and the ball rolled off his shin for a corner.

The impression at the interval was that we were in for penalties and a long night, which was how it turned out, just not in the way anyone expected.

Greece came close to scoring again after Lazaros Christdoulopoulos won a free-kick at the start of the second half. Holebas took it and Samaras rose unchallenged for a header, only to direct the ball straight into Navas’s arms. Costa Rica were not looking as invincible as they had in the group stage and were beginning to look even fairly ordinary. Yet Greece are pretty ordinary, too, and when they look back at the 52nd-minute goal that handed their opponents the initiative they will kick themselves for some statuesque defending.

Christian Bolaños simply rolled a pass along the edge of the penalty area where Ruiz was allowed time to meet it with his left foot. What the shot lacked in speed or power it made up for in accuracy. A static Papastathopoulous watched it slide by in slow motion and by the time Orestis Karnezis realised he needed to get across his goal he had left it too late and the ball was trickling over the line. They all count, but Ruiz might now hold some sort of record for the slowest goal of the tournament.

Costa Rica might have had a penalty on their next attack and the Australian referee booked Esteban Granados on the substitutes’ bench for grumbling about the non-award, before the script took another turn with a second booking for Duarte. The defender had been shown yellow in the first half for a foul on Christodoulopoulos and, when he brought down Holebas in front of Ben Williams, the official brought out a second.

That left Costa Rica just over 20 minutes to play out against 10 men. One side strengthened its defence, the other looked to beef up its attack.

Campbell found himself alone beyond the half way line. Greece’s best chance of an equaliser seemed to have gone when Christodoulupoulos found Mitroglou on the six- yard line two minutes from the end but the Fulham player could not accept the opportunity and from his poor first touch the ball ended up in the goalkeeper’s arms.

Navas was booked shortly after that, a little fussily, for taking his time over a goal-kick, before Papastathopoulos provided the day’s second last-minute drama with an equaliser in the 91st minute. Gekas saw a shot saved by Navas but the goalkeeper could only parry and Papastathopoulos pounced. There was ime for Greece to come again and Navas, arching backwards, made a fine save from Mitroglou’s header in the dying seconds to take the game into extra-time and its scarcely credible conclusion.