The straitjacket was off and liberated Greece secured their first-ever place in the last 16 of a World Cup on a dramatic night in Fortaleza. In the 92nd minute Ivory Coast had that historic achievement to savour at Greece’s expense. In the 93rd the roles switched on a penalty and the Elephants were sent to the graveyard. For the lauded generation of Didier Drogba and co, on their knees when the Ecuadorian referee pointed to the spot in injury-time, it is all over.

Georgios Samaras has long since shed the “tragedy” label he attracted at Manchester City and produced a triumphant night for Greece with a nerveless spot-kick to clinch qualification for a team that had been bottom, without a goal, from the opening game. “I don’t remember anything. It was a total black-out,” he said of the chance to seal victory. “All I could think about what putting the ball in the net and making the people happy back home.”

Ivory Coast’s coach, Sabri Lamouchi, had replaced strikers Didier Drogba and Gervinho in the final stages as he sought to cling on to Wilfried Bony’s equaliser knowing that a draw, coupled with Japan’s defeat by Colombia, would suffice. They would prove his final acts in the job. Lamouchi confirmed his contract would not be renewed after the World Cup. He leaves behind another late of lost opportunity for the Ivory Coast. “It was a cruel way to lose but that is football,” he lamented.

Celebrations at Greece’s advance may not wash far beyond the Aegean Sea but credit the coach Fernando Santos for his steadfast belief in a style that has begun to grate with own supporters, though not on nights like this. He would not bow to pressure for change and maintained a side without a World Cup goal to its name before the final group game would deliver. He was correct on both counts but there was more to Greece’s progress into a last 16 meeting with Costa Rica on Sunday than resilience.

Santos’s team were simply better. They hit the woodwork three times, led through the substitute Andreas Samaris but looked to be out when Bony levelled in the 74th minute. They would not be denied and, in the dying seconds, Gervinho’s replacement Giovanni Sio clipped Samaras in the area and the former Celtic striker picked himself up to send Greece through.

“The best team won,” said Santos. “In terms of intelligence, strategy and the passion of the players, that scores two goals, hits the woodwork three times and had other chances, it is a deserved victory. We are going up in levels with each game. It was a very fair and just victory.”

Moving Samaras in from the left to lead the attack added potency to the Greece display and they were content to wait for a set-piece opportunity, a counter-attack or a mistake from a careless Ivory Coast defence. Option three did not fail them even after their rhythm had been disrupted by losing Panagiotis Kone and goalkeeper Orestis Karnezis to injury inside 24 minutes. Once they regrouped, however, Greece were the more purposeful, effective side and could have taken the lead when the excellent Jose Cholevas struck the bar.

Ivory Coast failed to heed the warnings and gifted Greece a vital breakthrough minutes before the interval. And what a gift. Taking a routine pass deep in his own half, Cheick Tioté undercooked his touch towards Kolo Touré and Samaris intercepted. The Newcastle midfielder already had his head in his hands as Samaris played a one-two with Samaras and swept a nerveless finish over the advancing Barry.

Santos’s side continued to prosper on the counter after the restart and were desperately unlucky to hit the bar for a second time when Karagounis unleashed a shot from almost 30 yards that left Barry flailing but struck the woodwork. Lazaros Christodoulopoulos also had a decent chance after cutting inside Souleymane Bamba but dragged his effort wide and Vasileios Torosidis’s cross hit the outside of the post late on.

By then, Bony had thrown a lifeline to Ivory Coast. The Swansea City striker was summonsed from the bench with half an hour remaining as Lamouchi went for broke. Whenever they did create an opening the Greece central defender Konstantinos Manolas usually intervened but Ivory Coast pressure prevailed when Salomon Kalou released Gervinho inside the area.

The Roma forward squared first time and there was Bony to slide a trademark finish inside the near post. But there was no reprieve as Greece finally delivered. Just on time.