Experienced Congo-Brazzaville goalkeeper Barel Mouko missed the only spotkick of the shootout as Libya won 5-3 on penalties after a 1-1 draw to advance to the African Nations Championship semi finals.
Libya, who advanced as runners-up behind Nigeria in Group C after beating Rwanda at the death in their final group game, took the lead in the 15th minute through Saleh Taher after Mouko parried a cross into his path.
However, Congo responded through Junior Makiesse, when the AC Leopards de Dolisie forward slammed home in the 37th minute after being played in by wonderkid Vieljeux Mboungou.
The North Africans, who now advance to meet Morocco in the first semi final in Casablanca, thought they should have won a penalty in extra time when Moftah Taktak was brought down in the box.
The first five scorers in the shootout scored their spot kicks before Mouko, the oldest player at the tournament, surprisingly stepped up to take the Red Devils' third penalty.
His powerful effort was blasted over the bar to hand the initiative to Libya, and after Ahmed Mohamed Al. Maghasi and Varel Rozan converted their spot kicks, it was left to Sand Masaud to deliver the coup de gras.
2014 CHAN winners Libya advance to meet the Atlas Lions, 2-0 victors over Namibia in their quarter, on January 31, before Sudan face Nigeria in the day's second final-four clash.
The Super Eagles saw off Angola after extra time earlier on Sunday, while Sudan advanced past Zambia in Marrakech on Saturday.