Co-hosts Gabon win thriller to reach quarters
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 half-time 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 half-time, 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.
"The turning point came when Pierre-Emerick scored, the crowd gave us new energy to push on," said Rohr. "But then to lose the 2-1 lead and still fight back and win the game shows an incredible determination from my players."
A handball in the 89th minute by defender Charly Moussono saw Houcine Kharja calmly convert the resultant penalty to make it 2-2.
Kharja had also fired Morocco ahead in the 24th minute but they lost momentum in the second half, coach Eric Gerets said.
"Tactically we lost in the last 20 minutes, the team did not seem capable of doing what we had done so many times in the past," he said.