Benin beat Morocco 4-1 on penalties to reach the quarterfinal of the AFCON for the first time.
The game which was played at the Al Salam Stadium saw Benin take the lead in the 59th-minute courtesy Moise Adilehou when he connected home from a well-taken corner.
Morocco after conceding the goal dominated possession but struggled to break down the resilient defence of the Squirrels.
They threw everything at Benin with coach Herve Renard bringing on Sofiane Boufal for Younes Belhanda. Boufal nearly equalised for the Moroccans but his header missed the target by inches a minute after his introduction.
Herve Renard's substitution paid off when Boufal stole possession and teased the ball to En Neresyi who restored parity for the Atlas Lions in the 76th minute.
Benin had to play the majority of the extra time with 10-men following Khaled Adenon's red card.
In the shootout, Morocco missed two of their kicks as Benin converted all four of theirs to book quarterfinal qualification for the first time in their history.