Sudan beat Libya 4-2 on penalties following a 1-1 draw in Sunday's African Nations Championship third-placed playoff in Marrakech.
The Falcons of Jediane took the lead in the eighth minute through youngster Waala Musa's header.
However, Libya, who enjoyed the better of the contest, equalised in the 84th minute when substitute Salem Ablo headed past Akram after a defensive mixup.
While Sudan converted all four of their spotkicks in the shootout, Elmehdi Mohamed Elhouni missed his shot - Libya's second - before Ablo's effort was saved by Akram, making up for his earlier error, to condemn the Mediterranean Knights to defeat.
The victory represents small consolation for Sudan after they were denied a spot in the final by the heroics of Nigeria's substitute goalkeeper Dele Ajiboye in their 1-0 semi-final defeat by the Super Eagles on Wednesday.
Libya reached the semis after beating Congo on penalties in the quarter final, but their luck from spotkicks ran out here.
Nigeria meet hosts Morocco in Sunday's final in Casablanca to bring the curtain down on the 2018 CHAN.