Match ends, Madagascar 2(4), Congo DR 2(2).
Africa Cup of Nations debutants Madagascar produced another upset to beat DR Congo 4-2 on penalties after a 2-2 draw and seal a quarter-final spot.
In a thriller, Madagascar took a surprise lead through Ibrahim Amada's superb 20-yard strike before Cedric Bakambu equalised with a header.
The Indian Ocean islanders restored their lead through Faneva Andriatsima's header before Chancel Mbemba's 90th-minute equaliser forced extra-time.
Madagascar scored all their penalties.
In contrast, DR Congo missed two, with Everton winger Yannick Bolasie's attempt going over the bar to confirm Madagascar a quarter-final against Ghana or Tunisia in Cairo on Thursday.
Having beaten three-time winners Nigeria in the group stage as well as Burundi, Madagascar's fairytale run continues after another impressive performance in Alexandria, Egypt.
They were 190th in Fifa's rankings five years ago but have now advanced further in this tournament than hosts Egypt and holders Cameroon, both of whom went out on Saturday.
Before their 90th-minute equaliser, DR Congo were denied a penalty in controversial circumstances when Britt Assombalonga appeared to be fouled by Thomas Fontaine.
However, with the video assistant referee system not being used until the quarter-finals, their appeals were ignored.
BBC Sport's Piers Edwards in Alexandria
This is one of the all-time fairytale stories in Africa Cup of Nations history because Madasgacar's run needs real perspective.
Because they were ranked among the six worst teams on the continent, they took part in the very first match of this 2019 Nations Cup campaign - in the preliminary round of qualifying, against Sao Tome e Principe in early 2017.
Three players who started that game played in this one, a match which makes them among the best eight sides in Africa - an unbelievable dream.
The "Barea" played well, with real heart and passion, during 90 minutes but tired considerably in extra time when they were lucky to hold on.
But they have squeezed through - and given the Cup of Nations expansion from 16 to 24 teams every justification, in the face of criticism from some.
- 18RavelosonSubstituted forAndrianarimananaat 58'minutes
- 12NomenjanaharySubstituted forCaloinat 89'minutes
- 9AndriatsimaSubstituted forRakotoharimalalaat 112'minutes
- 2AndriamahitsinoroSubstituted forMorelat 105'minutesBooked at 113mins
- 2MpekoBooked at 97mins
- 6AkoloSubstituted forBolasieat 70'minutes
- 12MokeSubstituted forEliaat 45'minutes
- 7MulumbuBooked at 45minsSubstituted forBokadiat 67'minutes
- 19AssombalongaSubstituted forM'Pokuat 90'minutes
- Noureddine El Jaafari
- Shots on Target
Penalty Shootout ends, Madagascar 2(4), Congo DR 2(2).
Penalty missed! Bad penalty by Yannick Bolasie (Congo DR) right footed shot is too high. Yannick Bolasie should be disappointed.
Goal! Madagascar 2(4), Congo DR 2(2). Jerome Mombris (Madagascar) converts the penalty with a left footed shot to the centre of the goal.
Goal! Madagascar 2(3), Congo DR 2(2). Paul-José M'Poku (Congo DR) converts the penalty with a right footed shot to the centre of the goal.
Goal! Madagascar 2(3), Congo DR 2(1). Thomas Fontaine (Madagascar) converts the penalty with a left footed shot to the top right corner.
Goal! Madagascar 2(2), Congo DR 2(1). Cédric Bakambu (Congo DR) converts the penalty with a right footed shot to the bottom left corner.
Goal! Madagascar 2(2), Congo DR 2. Romain Métanire (Madagascar) converts the penalty with a right footed shot to the bottom right corner.
Penalty missed! Bad penalty by Marcel Tisserand (Congo DR) right footed shot is too high. Marcel Tisserand should be disappointed.
Goal! Madagascar 2(1), Congo DR 2. Ibrahim Amada (Madagascar) converts the penalty with a left footed shot to the high centre of the goal.
Penalty Shootout begins Madagascar 2, Congo DR 2.
Second Half Extra Time ends, Madagascar 2, Congo DR 2.
Foul by Chancel Mbemba (Congo DR).
Adrien Melvin (Madagascar) wins a free kick in the defensive half.
Corner, Congo DR. Conceded by Romain Métanire.
Merveille Bokadi (Congo DR) wins a free kick in the attacking half.
Foul by Njiva Rakotoharimalala (Madagascar).
Corner, Congo DR. Conceded by Pascal Razakanantenaina.
Attempt missed. Yannick Bolasie (Congo DR) right footed shot from the left side of the box misses to the right. Assisted by Meschak Elia following a corner.
Corner, Congo DR. Conceded by Ibrahim Amada.