Benin eliminated Morocco after a penalty shootout at the 2019 Africa Cup of Nations on Friday.
The last-16 game ended 1-1 at full-time, with Hakim Ziyech missing a 96th-minute penalty that would have given Morocco the win.
Neither team could score a second goal in extra time, and it was Benin who won 4-1 in the shootout.
Meanwhile, Senegal beat Uganda 1-0 in their last-16 match. Sadio Mane scored the only goal of the game after 15 minutes but missed a second-half penalty.
Friday's AFCON Results
Morocco 1-1 Benin (Benin win 4-1 on penalties)
Uganda 0-1 Senegal
Nigeria vs. Cameroon, 6 p.m. local, 5 p.m. BST, 12 p.m. ET
Egypt vs. South Africa, 9 p.m. local, 8 p.m. BST, 3 p.m. ET
Full scheduling for the rest of the tournament can be found at CAFonline.com.
It was an agonising occasion for Morocco after they allowed the chance to advance slip through their fingers.
The Moroccans had dominated possession in the first half, and they appeared the most likely to break the deadlock after half-time.
However, Moise Adilehou netted against the run of play after 53 minutes for Benin, with the scorer latching onto Cebio Soukou's cross.
The Atlas Lions immediately retaliated in their chase for an equaliser, and the game was drawn level by Youssef En-Nesyri with 15 minutes remaining.
En-Nesyri found the bottom corner, allowing his team the opportunity to push for a victory.
A Moubarak Boussoufa free-kick almost gave Herve Renard's side the winner in the last minute, but Benin continued to defend in numbers, with extra time on the cards.
There appeared to be disaster for Benin deep into injury time. Stephane Sessegnon fouled Achraf Hakimi in the box, allowing Ziyech a last-gasp chance of closing out the game.
However, the Ajax player hit the post from the penalty spot, and the game went into extra time.
Benin's Khaled Adenon was given his marching orders for a second yellow card in the first half of extra time.
Benin sat deep and hung on to force penalties. In the shootout, Morocco's Sofiane Boufal missed the target, and Benin took a 3-1 lead.
En-Nesyri then missed from the spot, allowing Mama Seibou to convert for a famous victory for the surprise winners.
Senegal will meet Benin in the quarter-finals after defeating Uganda.
Both teams were group runners-up, but Senegal's strength and depth gave them the edge.
Uganda had plenty of moments in attacking positions, but they failed to convert opportunities.
Senegal had only two shots on target in the game, and Mane's early finish was enough to advance.
Uganda goalkeeper Denis Onyango was lucky not to be sent off on the hour mark, with the stopper sliding through Mane in the box.
However, the poor challenge was not punished from the spot. Mane's penalty was saved, providing hope for the Cranes.
Uganda rallied in the closing stages, but they failed to hurt the Senegalese defence marshalled by Napoli's Kalidou Koulibaly.