Hosts Algeria equalled two African Nations Championship (CHAN) records as a Hocine Dehiri goal gave them a 1-0 win over Mozambique on Saturday in a Group A final-round match.
They became the third country after South Africa and Cameroon to qualify for the knockout phase by winning all three group matches, and the second after Cameroon to do so without conceding.
Coach and former star defender Madjid Bougherra called Algeria "efficient" after 1-0 wins over Libya, Ethiopia and Mozambique before packed crowds at the 40,000-seat Stade Nelson Mandela.
Algeria had already qualified for the quarter-finals while second-placed Mozambique held a three-point advantage over Ethiopia.
Mozambique losing did not harm their qualification chances in the end as Libya put two earlier defeats behind them by coming from behind to beat Ethiopia 3-1 in the eastern city of Annaba.
Algeria topped the final standings with nine points followed by Mozambique (four), Libya (three) and Ethiopia (one).
The hosts will play the Group B runners-up next Friday in Algiers while Mozambique face the Group C winners the following day in Constantine, another venue in the east of the country.
Roared on by passionate supporters, Algeria put Mozambique under pressure from the kick-off and went ahead on seven minutes through a powerful Dehiri header off a corner.
There was a hold-up late in the opening half when concussed Mozambican goalkeeper Ivane Urrubal refused to leave the field for several minutes before medical staff persuaded him to do so.
Fasistencio Joao proved a capable replacement shot-stopper, making several reflex saves as Algeria sought the insurance of a second goal.
Ethiopia needed maximum points to have any chance of overtaking Mozambique and they went ahead on 39 minutes when Gatoch Panom converted a penalty.
But the lead lasted just five minutes before Ali Arqoub equalised and early and late second-half goals from Abdulati al Abbasi and veteran Anis Saltou sealed victory for Libya.
On Sunday, Group B reaches a climax with leaders Uganda facing bottom team the Ivory Coast and second-placed Senegal meeting two-time former champions the Democratic Republic of Congo.