Libreville - Fairytale qualifiers Libya enjoyed a bittersweet day on Sunday, defeating Senegal for their first Africa Cup of Nations win since 1982, yet missing out on the quarter-finals.
The Libyans' 2-1 defeat of already eliminated Senegal in Bata was insufficent to lift them into the last eight after Zambia beat Equtorial Guinea 1-0 in Malabo.
That left Zambia as the Group A winners, with the significant reward of avoiding a probable quarter-final date with competition favourites Ivory Coast.
That dubious honour now looks set to fall to Group A runners-up Equatorial Guinea.
Topping the table means the Zambian Copper Bullets are likely to face Angola or Sudan in the quarter-finals next Saturday.
Zambia's French coach Herve Renard said: "The aim was to secure first place, as in 2010 when we finished in front of Cameroon.
"Here, we're ahead of the co-hosts, who were on cloud nine after beating Senegal.
"It wasn't a great match but the important thing was to get the points.
"Now it's imperative we get to the semi-finals for the first time since 1996."
His Equatorial Guinea counterpart Gilson Paulo said: "I'm disappointed because this loss has a bearing on the rest of the competition. But we are still not certain we'll be facing Ivory Coast."
Zambia captain and striker Christopher Katongo settled a cagey Nuevo Estadio de Malabo clash of few scoring chances on 67 minutes, beating Brazil-born goalkeeper Danilo with a hard low shot.
Although the Equatoguineans are 25 places below the Zambians on the African rankings, there was no evidence of a yawning gap between the teams with the National Lightning holding their own entering the final quarter.
However, a goal out of nothing from China-based Katongo silenced the crowd as a throw-in set up the former army sergeant to beat Danilo with a shot into the corner of the net.
At the simultaneous match over on the mainland in Bata Libya celebrated their first victory since defeating Zambia 30 years ago when they hosted the competition.
Libya went in front after just five minutes through Ihab Abousaifi.
Senegal responded six minutes later, when Deme Ndiaye rose above the Libyan defence to head home a corner. Abousaifi scored his second goal six minutes from time with a fine volley.
Afterwards Libyan coach Marcos Paqueta commented: "We didn't have any other choice but to take risks, and it worked. This is an important result for us after what's happened in Libya and the tough conditions endured.
"Among the difficulties is the fact that most of the players haven't been attached to clubs, they've been through a war and there have been psychological consequences.
"This (win) has crowned the efforts made since the start of the competition.
"I hope after their good performance here the players will be granted good conditions in Libya in the future."
A defiant Senegal coach Amara Traore said: "I won't resign, even if the responsibility rests with the manager.
He added: "I began this project two years ago, the team can't be useless. I've got the strong desire to continue.
"To call for the head of Amara or the (sports') minister doesn't achieve annything. As the 2013 (qualifying) Nations Cup approaches there are things to improve...but not by giving the team to a Mourinho, Capello or Ferguson."
Group B wraps up on Tuesday with Sudan requiring all the points against Burkina Faso in Bata and already qualified Ivory Coast to beat Angola in Malabo to put them in contention for a last eight place depending on goal difference.