Africa Cup of Nations title favourites Algeria beat the Ivory Coast 4-3 on penalties in Suez on Thursday to the relief of Baghdad Bounedjah and set up a semi-final against Nigeria.
The quarter-final finished 1-1 after extra time with Sofiane Feghouli giving Algeria a 20th-minute lead that was cancelled by Jonathan Kodjia on 62 minutes.
In the shootout, Youcef Belaili struck the woodwork when he had a chance to clinch victory for Algeria, then Ivory Coast captain Serey Die hit the same post and his team were eliminated.
Forward Bounedjah missed a penalty in the second half of regular time and was visibly upset by his failure, fearing it would cost Algeria a first last-four place since 2010.
It was a tense tussle between former champions, but 58 fouls and 22 of 36 goal attempts finishing off target prevented it becoming a spectacle.
Shootout victories are classified as draws so Algeria surrendered the last 100 percent record in the tournament after wins over Kenya, Senegal, Tanzania and Guinea.
“The match was very difficult as the Ivory Coast were compact, organised and waiting for mistakes from us,” said Algeria coach Djamel Belmadi.
“My thoughts are with Youcef Atal after he came off in the first half with a shoulder injury. This is the only dark spot tonight.
“I think we are heading towards the end (of the tournament for him). A player like him deserved to go into the next battle, against Nigeria.”
Algeria retained the team that started a last-16 demolition of Guinea, a result which confirmed the belief of many rival coaches that the Desert Foxes are the team to beat.