Chancel Mbemba’s late header took the tie to extra time.
Yannick Bolasie missed from the spot as Africa Cup of Nations debutants Madagascar beat DR Congo in a dramatic penalty shoot-out to reach the quarter-finals.
Marcel Tisserand had already skied his attempt over the bar when Bolasie followed suit to hand the Barea a 4-2 shoot-out victory in Alexandria, with the game having finished 2-2 after extra time.
Madagascar took a ninth-minute lead in spectacular style when wide man Ibrahim Amada lashed home a swerving drive past keeper Matampi Ngumbi from the edge of the penalty area, only for Cedric Bakambu to level within 12 minutes.
The Barea who regained the lead with 13 minutes remaining courtesy of Faneva Andriatsima’s diving header.
However, Chancel Mbemba restored parity with a bullet header in the final minute of normal time to take the tie to an extra 30 minutes which the Leopards dominated, but they were unable to make the pressure tell and it was they who wilted when penalties arrived.