Zambia's Christopher Katongo does a somersault celebration after scoring the only goal against Ecuatorial Guinea.

Story highlights

Libya beat Senegal 2-1 in final Group A qualifier

Libya go out of Africa Cup of Nations despite victory

Zambia beat co-hosts Equatorial Guinea 1-0

Zambia top group after second victory in group

CNN  — 

Libya went out of the 2012 Africa Cup of Nations despite a 2-1 win over Senegal in their final Group A match at Estadio de Bata Sunday.

Ihab El Busaifi scored twice for the surprise qualifiers to give them their first victory in the tournament, but they finished three points behind group winners Zambia and two adrift of runners-up Equatorial Guinea.

Senegal, who had gone into the finals as one of the favorites, finished rock bottom of the group with three losses.

Zambia defeated co-hosts Equatorial Guinea 1-0 Sunday to win the group on seven points.

They will now face the runners-up from Group B in Bata, while Equatorial Guinea will take on the winners of Group B, most likely the Ivory Coast, in Malabo for a place in the last semifinals.

Blog: Expect more shocks at the Africa Cup of Nations

Senegal made six changes to the team who lost 2-1 to Equatorial Guinea in their second group match, dropping goalkeeper Khadim Ndiaye and misfiring strikers Souleymane Camara and Demba Ba, who came to the tournament with big reputations.

Libya took the lead after just five minutes through Abousaifi after he was set up by Ahmed Osman.

Senegal hit back six minutes later when Deme Ndiaye headed home.

They had chances to record their first win, but it was Abousaifi who grabbed the winner for Libya six minutes from time with a superb volley.

Zambia owed their victory over Equatorial Guinea at the Nuevo Estadio de Malabo to a goal from captain Christopher Katongo after 67 minutes.