Story highlights

Equatorial Guinea beat Senegal 2-1 to qualify for Africa Cup of Nations quarterfinals

David Alvarez's late goal means Senegal are knocked out of the tournament

Zambia twice fight back from a goal down to draw 2-2 with Libya in other Group A game

Results means the second qualification place will go to either Libya or Zambia

CNN  — 

Equatorial Guinea booked their place in the Africa Cup of Nations quarterfinals and sent Senegal tumbling out of the competition with a dramatic 2-1 win.

David Alvarez’s goal four minutes into stoppage time at the end of the game sealed a thrilling victory for the tournament’s co-hosts who were rank outsiders to progress from Group A.

But it means heartbreak for Senegal, who are rock bottom of the group and cannot qualify for the last eight.

Senegal dominated large chunks of the game but Iban Iyanga put Equatorial Guinea – ranked 151st in the world – ahead on 62 minutes.

That looked like being enough to seal the game until substitute Moussa Sow equalized with a minute of normal time left, only for Alvarez to drill a shot into the net to delight the vociferous home crowd.

The Equatorial Guinea sqaud, who received a bonus of $1 million from Teodoro Nguema Obiang Mangue, son of Equatorial Guinea’s president, for their win in the opening game of the tournament over Libya can now expect another reward.

In Wednesday’s other match, Zambia twice fought back from a goal down against Libya to draw 2-2 in Bata and put themselves in the driving seat to qualify second in the group.

Torrential rain delayed kick-off but when the match did get under way, large sections of the pitch were covered with standing water.

Despite the poor conditions, it took Libya just five minutes to score as Walid El Khatroushi played in Ahmed Osman who finished calmly.

Zamiba were level on the half hour as Rainford Kalaba’s cross was expertly hooked into the net by Emmanuel Mayuka.

But Libya again edged in front just after half time when Osman displayed neat footwork in the area to squeeze a shot in off the post.

Back came Zambia though, as Christopher Katongo headed in at the back post on 54 minutes. Zambia have four points to Libya’s one going into the final group games.