Sudan beat Libya 4-2 on penalties after a 1-1 play-off draws in Marrakech on Saturday.
The result means the Falcons of Jediane ended up third for the second time in the African Nations Championship.
Sudan impressively took the lead on eight minutes when Walaa Eldin Musa headed in to break the deadlock.
The Libyans fought hard for their equaliser just six minutes to the end with a goal from Salem Ablo.
Another bronze medal for Sudan at the CHAN finals after they were third when they hosted the tournament in 2011, while Libya were champions three years later.
Morocco host Nigeria Sunday in an eagerly anticipated final at the 65,000-capacity Stade Mohammed V in Casablanca with a record $1.25 million (about one million euros) first prize at stake.
Total man of the Match: Mohamed Taher (Sudan)
— CAF (@CAF_Online) February 3, 2018
Follow Us on Twitter @football_sierra