Libya booked their place at the last four after beating Congo 5-3 on penalties in their quarter-final clash on Sunday in Agadir.
The encounter after 120 minutes ended one-all with Saleh Taher giving Libya the lead on the quarter-hour mark before Junior Makiesse drew level for the Congolese on 37 minutes.
Congo goalkeeper Barel Mouko was the villain for his side, blasting wide his kick from the spot, as the 2014 champions booked a date with host Morocco for a place in the grand finale.
Earlier, Mouko had kept his side in the game with some decent saves in a match that had Libya dominate possession slightly.
The Libyans, who have been a delight to watch at the tournament broke the deadlock on 15 minutes courtesy Taher, his third in as many matches. Mouko spilled Bader Ahmed's cross into play and Taher tucked home the rebound.
'Les Diables Rouges' responded in style and levelled seven minutes past the half-hour mark through Makiesse, after Prestige Mboungou headed his way from a Dimitry Bissiki cross from the left.
The game remained a balanced affair with both teams failing to make their midfield possession count on the score sheet.
Libya resumed stronger with Abdelrahman Ramadan and Taher coming close a couple of times.
Substitute Abdelsalam Alaqoub should have sealed victory for Libya four minutes from time after Ramadan had put him through, only for him to shoot feebly into the waiting hands of Mouko as the game headed into extra time.
With both teams failing to score, the match had to be decided on penalties where Libya had the last laugh. Moftah Taktak, Ramadan, Alaqoub, Ahmed Almaghasi and Sand Masaud score for Libya whilst Francouer Kibamba, Mboungou and Varel Rozan hit target for Congo.
Total Man of the Match: Abderahman Ramadan (Libya)