The tension in the final minutes was almost unbearable
Egypt and Algeria face a play-off in Sudan on Wednesday to decide which of them will go to the World Cup.
The two rivals finished level on points and goal difference in Group C after Egypt's 2-0 win in Cairo.
Substitute Emad Moteab scored late in inury time to secure this World Cup lifeline.
The Pharaohs needed a 3-0 win to qualify outright but Moteab's strike has given the African champions another opportunity.
As if to state their intentions from the start, Amr Zaki netted just two minutes into the game after a shot from Mohamed Aboutrika rebounded off the post.
Algeria missed several opportunities to draw level.
Zaki was substituted for Moteab mid-way through the second half, and it was his header that changed the outcome with just seconds to go.
Egypt's coach Hassan Shehata pushes his team towards a World Cup play-off
Until then Egyptian fans were starting to come to terms with missing out on South Africa 2010.
The build-up to this North African derby had been troubled with the stoning of the Algerian team bus on their arrival in Cairo.
There will be some who say that a play-off in Sudan is perhaps the safer solution when so much emotion is involved and so much is at stake between these two bitter rivals.
Meanwhile Zambia have qualified for the Africa Cup of Nations after a goalless draw against Rwanda in Kigali.
Zambia's Rainford Kalaba had a goal disallowed for being off-side on the stroke of half time, but Rwanda dominated the encounter.
Bookmark with:
What are these?