Egypt and Ivory Coast are through to the final of the U23 Africa Cup of Nations after semi-final victories on Tuesday.
The wins mean the pair have secured qualification for the Olympic Games in Tokyo in 2020.
Hosts Egypt beat South Africa 3-0 in their semi, whilst Ivory Coast overcame Ghana on penalties after a 2-all draw.
The beaten semi-finalists will compete for Africa’s final spot in Tokyo in the 3rd/4th place play-off on Friday.
Egypt, playing in front of a vocal home crowd, took the lead against South Africa through captain Ramadan Sobhy’s 59th minute penalty.
Abdel Rahman Magdy scored twice late on to give them an emphatic 3-0 victory.
“It was huge playing [in front of] all these crowds,” the Olympic Pharaohs’ Taher Mohamed told the BBC after the game.
“That’s the thing that helped us a lot in the four games – the crowd. We feel very proud that we qualified for the Olympics.”
The earlier match was a much tighter contest, decided in Ivory Coast’s favour by a penalty shoot-out over Ghana.
The Ivorians took the lead twice through Youssouf Dao only for Ghana to equalise – with the second coming in stoppage time at the end of the game.
Neither side could break the deadlock in extra-time, although both went close, and Ivory Coast took the penalty shootout 3-2.
Ghana’s Evans Mensah acknowledged the pressure of trying to perform for the expectations of the country’s fans, and to claim the last available Olympic spot on Friday.
“We have the last game to prove to ourselves that we can do it … we have to be focused, we don’t give up,” he said.
Their play-off against South Africa is on Friday, with the final to follow on the same day.