Hakim Ziyech's missed spot-kick at the end of normal time proved costly as Morocco suffered a shock 4-1 penalty shoot-out defeat to Benin in Friday's action-packed opening Africa Cup of Nations last-16 tie, which ended 1-1.
Much-fancied Morocco won all three of their group matches by a 1-0 scoreline and were overwhelming favourites to overcome a Benin side who progressed with three successive draws, and were debutants in the knockout rounds.
But Ziyech missed a penalty six minutes into added time after Youssef En-Nesyri had scored late on to cancel out Moise Adilehou's opener against the run of play.
And despite having Khaled Adenon sent off in extra time, Benin came out on top in the shoot-out, with Sofiane Boufal and En-Nesyri the players to miss.
En-Nesyri and Ziyech were denied by Saturnin Allagbe in the best of the first-half opportunities.
Morocco managed to inject some urgency into their game early in the second half and Younes Belhanda skied another good chance over the crossbar.
They were punished for their profligacy with 53 minutes played as Benin defender Adilehou made the most of some lacklustre defending to send a controlled volley past Yassine Bounou.
Boufal missed the target with his free header but, just when Morocco looked to have run out of ideas, Jordan Adeoti was caught in possession by Moubarak Boussoufa high up the pitch and En-Nesyri made no mistake when played in on goal.
Ziyech then struck the post with his last-gasp penalty after Stephane Sessegnon had brought down Achraf Hakimi in the box, before Adenon was shown a second yellow for dissent seven minutes into extra time.
But Herve Renard's men failed to find a way through and they were second best in the shoot-out, with Mama Seibou converting the decisive penalty for jubilant Benin.
Benin's first-ever AFCON quarter-final will be against either Senegal or Uganda.
Key Opta Facts:
- Morocco have not won a knockout stage game in the Africa Cup of Nations since February 2004, a semi-final victory over Mali (4-0).
- Boufal is the player who has completed the most dribbles (14) in the 2019 Africa Cup of Nations.
- En-Nesyri has been directly involved in four of Morocco's last six goals in the Africa Cup of Nations (three goals, one assist).
- Adilehou is the first defender to score a goal for Benin in the Africa Cup of Nations.