Cairo fell silent as French-born Anthar Yahia scored from an acute angle five minutes before the break to give Algeria the victory in the Sudanese city of Omdurman.
Earlier, the city had been mobbed with fans waving flags, chanting, and honking their car horns.
Police in at least one of the dozens of trucks deployed around the city had joined in the chants and cheers.
Outside the Algerian Embassy, where riot police had been deployed to protect the building in case of trouble, a gruff-looking officer wiped a tear from his eye. A mother dragged her distraught child, telling him, "Never mind, we'll win next time."
In an apparent attempt to rally deflated spirits, several hundred Egyptian fans gathered in Cairo's central Tahrir Square to beat drums, wave the flag and sing.
"I don't understand," one onlooker said to his friend, surveying the crowds of dancing young men. "Just what are they so happy about?"
The scene was entirely different in Khartoum, where Sudanese football fans, many of whom supported Algeria, flocked to the streets in celebration, honking horns, cheering and waving Algerian flags.
"I've never seen anything like this here," one bemused resident shouted over the din. "This is the biggest thing Khartoum has seen in years."
Sudan, which is not a typical tourist destination, has received tens of thousands of football fans. Politicians have been among the planeloads of people who have jetted in.
Many in Khartoum had flocked home early on what had been deemed a half-day. Heavily armed police lined the streets, cordoning off many of the city's main thoroughfares.
Authorities in Egypt and Algeria took similar precautions. Media reports in the French city of Marseilles, home to a large Algerian population, and Kuwait City, home to a large Egyptian population, said security had been beefed up.
In Cairo after the game, the precautions seemed unnecessary. The angry or joyous mobs many had expected did not materialise. Stunned and dejected fans shuffled home. People had little to say.
Tensions had been high since Saturday, when Egypt scored in the last minute to give "The Pharaohs" the 2-0 victory they needed to stay alive and face Algeria in the playoff in Sudan.
In the buildup to Wednesday and Saturday's matches, Egyptian and Algerian fans had gone to war online, through songs recorded for the occasion, and on television and radio.
Passions have had diplomatic repercussions, and businesses and fans were attacked in Algiers and Cairo.
The tensions follow a rivalry that has simmered for decades. Fans rioted when Egypt beat Algeria in 1989 to qualify for the World Cup. Neither team had qualified since.