Algeria ended their African Nations Cup in disgrace as they had three men sent off in their 4-0 defeat to Egypt in the second semi-final.
The game was evenly poised until Rafik Halliche felled Emad Moteab in the box eight minutes before the break, earning a red card for his troubles, and Hosni Abd Rabou converted the spot-kick. Mohamed Zidan added a classy second after 65 minutes before Nadir Belhadj saw red for a horror challenge on Ahmed El Mohamady five minutes later.
Mohamed Abdelshafy grabbed his first goal for Egypt nine minutes from time, but there was still time for Algeria goalkeeper Faouzi Chaouchi, who should have been dismissed in the first half, to pick up a second yellow and for Mohamed Gedo to make it 4-0 in stoppage time.
It was revenge for Egypt who missed out on a World Cup spot when they were beaten by their rivals in a play-off.
Earlier, Asamoah Gyan scored the only goal to help a well-organised Ghana book their place in the final with a battling 1-0 victory over regional rivals Nigeria.
The only goal came midway through the first half when a Kwadwo Asamoah corner caught out the napping Super Eagles defence and the in-form Rennes striker applied the finishing touches.
It was one-way traffic thereafter as wasteful finishing from their opponents, coupled with some dogged defending and some especially solid goalkeeping from Wigan goalkeeper Richard Kingston, helped the four-time former winners seal a place in the final for the first time since 1992.