A stunning last-gasp freekick from substitute Bruno Zita Mbanangoye sent co-hosts Gabon into the African Nations Cup quarter-finals after a dramatic 3-2 win over Morocco on Friday.
The strike from outside the penalty area in the fifth minute of stoppage time, much to the delight of some 40,000 fans, completed a come from behind win and ensured an early exit for Morocco, one of the pre-tournament favourites.
Gabon's win also ensured Tunisia's progress from Group C.
Gabon, whose young players were hailed by coach Gernot Rohr for their fighting spirit, had fought back from a halftime deficit with two goals in a three minute spell late in the game but that proved only the start of the drama to come.
They went 2-1 ahead, only to give away a penalty in the 89th minute. But then Mbanangoye hammered home a thunderbolt to lift the lid on delirious celebrations in the Gabon capital.
Pierre-Emerick Aubameyang brought Gabon level with a volley in the 77th minute and then two minutes later provided Daniel Cousin with the second goal.
Cousin, brought on at halftime, turned and squeezed a shot from Aubameyang's pass in off the post to spark a mini crowd invasion by home fans. Appeals for the home crowd to stay calm were repeatedly broadcast over the tannoy.
A handball in the 89th minute by defender Charly Moussono saw Houcine Kharja calmly convert the resultant penalty to make it 2-2.