Egypt provided more late drama at the African Nations Cup when they snatched the last place in the semifinals with an 87th-minute goal to beat Morocco 1-0 on Sunday.
Egypt went into the last four at their first ANC in seven years when Mahmoud Kahraba hooked in a volley after a goalmouth scramble right near the end of the last quarterfinal in Gabon.
Egypt's progression completed the semifinal lineup, and it includes the three most successful teams ever at this tournament, and a long-shot that has never won the title.
Record seven-time champion Egypt plays the surprise team, Burkina Faso, on Wednesday. Ghana and Cameroon, both four-time winners, meet on Thursday.
Egypt's story goes on in Gabon after the team, the dominant force in African football for so long, failed to even make it to the last three African Nations Cups with political turmoil back home.
The nation is back this year -- and back in the last four in their first appearance since winning a third-straight African title in 2010.
Egypt also has had to deal with the problem of having just one goalkeeper left fit, 44-year-old Essam el-Hadary, the oldest player at the tournament.
On Sunday, El-Hadary kept out the Moroccans and he celebrated wildly with teammates at the end.
Morocco's elimination ended coach Herve Renard's search for a third title with three different teams.
Earlier on Sunday, both Ayew brothers scored as Ghana survived a strong challenge from Congo DR to win 2-1 and advance to the semis.
Jordan Ayew gave Ghana the lead in the 63rd minute and Andre Ayew swept in a 78th-minute penalty for the winner after Congo had equalized at Stade d'Oyem.
Congo's equaliser, a curving long-range shot from Paul-Jose Mpoku soon after Jordan Ayew's opener, threatened another surprise for the tournament's popular underdog.
But Ghana kept their nerve and maybe established the Black Stars as the new title favorites in Gabon after Senegal's elimination on Saturday.
The definitive moment in Oyem came when Christian Atsu sped onto a pass late on and was tripped by Lomalisa Mutambala, giving Andre Ayew his chance from the spot.
He took it, and Ghana progressed to the semifinals for the sixth straight time at the Nations Cup. That hasn't meant much for Ghana, though, with the four-time champion still looking for a first triumph since 1982.
Ghana has lost in three finals and four semifinals since then, including an agonising defeat in a penalty shootout to Ivory Coast in the deciding game at the last African Cup. That experience two years ago left Andre Ayew sobbing and inconsolable.
The painful memories will likely keep Ghanaian feet on the ground this year, even after getting past Congo, a tricky adversary that qualified top of a group that contained defending champion Ivory Coast and Morocco.