Naim Sliti, Youssef Msakni, Taha Yassine Khenessi and Wahbi Khazri scored in Libreville as the Tunisian Carthage became the first side at the 2017 finals to score four goals in a match.
Algeria drew 2-2 with a virtual Senegal 'B' side in Franceville at the same time with star striker Islam Slimani finally finding form to bag a brace.
This was the second 2-2 draw for the Algerian Desert Foxes after a similar result against Zimbabwe, and a 2-1 loss to neighbours Tunisia in between proved costly.
Many pundits had placed Algeria among the title favourites given the presence of stars like new African Footballer of the Year Riyad Mahrez, Slimani and Yacine Brahimi.
Gabon crash out of Africa Cup of Nations
Pre-tournament fears about the defence proved well founded, however, as they conceded two goals in each group game.
Senegal, breaking a pre-match promise of coach Aliou Cisse that he would field a full-strength side, equalised first through Papa Diop and Moussa Sow.
Assured of finishing first before the last mini-league matches, Senegal topped the Group B standings with seven points followed by Tunisia (six), Algeria (two) and Zimbabwe (one).
Senegal stay in southeastern Gabon to face Cameroon on Saturday three hours after Burkina Faso and Tunisia meet in the first quarter-final in Libreville.
Cameroon beat Senegal on penalties in the 2002 final in Mali and hosts Burkina Faso also won on penalties when they met Tunisia in a 1998 quarter-final.
Algeria need their stars to shine in make-or-break fixture
Ghana are also through to the last eight and the other three quarter-finalists will be decided Tuesday and Wednesday with six countries in contention.
All the Group C teams, Democratic Republic of Congo, Morocco, defending champions Ivory Coast and Togo, can advance to the knockout phase.
In Group D, either record seven-time champions Egypt or Mali will accompany Ghana to the quarter-finals.
Henryk Kasperczak coached Tunisia to the 1996 final during a previous spell in charge and was thrilled with the victory over Zimbabwe.
"We regained possession well during the first half and created scoring chances," said the Poland-born handler. "It was a satisfactory performance and I congratulate my players. Now we face Burkina Faso, a quality team with good technique and attacking combinations."
Zimbabwe coach Callisto Pasuwa said: "We lost the match in the early stages due to a lack of concentration.
Morocco conquer Togo at Africa Cup of Nations
"I think we have potential, but must prepare better. A lesson from this tournament is that players have to remain focused throughout a game."
Tunisia scored four goals in a Cup of Nations match for the fourth time as they ripped the Zimbabwe defence to shreds during a first-half goal fest which ended with the winners 4-1 ahead.
The tempo inevitably slowed after half-time with both teams playing for the third time in nine days and Ndoro scored the lone second-half goal.
Algeria coach Georges Leekens took some consolation from the early exit as Algeria continued to underperform at the Cup of Nations since a lone title when 1990 hosts.
"I had warned that Senegal were one of the big favourites and we showed that we could respond in difficult circumstances, which is important for the future," he said.
"Overall it is a disappointment, but we need to use this to grow in the future," he added as Algeria are left to focus on trying to qualify for the 2018 World Cup in Russia.
"I am still sure of what I have to do. It was not a gift for me to come here but we will make it to Russia. I think my players showed they could react."
Slimani gave Algeria the lead on 10 minutes and after Diop levelled just before half-time, he struck again early in the second half only for Sow to equalise within a minute.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ