Defending champions Egypt strolled into the final of the African Nations Cup as eight-man Algeria bowed out in ignominious fashion.
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. They now face a final against Ghana, 1-0 victors against Nigeria earlier in the day.
For nearly 40 minutes it was an even contest.
Karim Matmour should have done better for Algeria 10 minutes in when, unmarked at the back post, me missed his kick.
A minute later Madjid Bougherra tried his luck from range. The shot was always skidding wide but was close enough to cause Essam El Hadari fleeting discomfort.
After 25 minutes, the mercurial Zidan combined well with Emad Moteab, who curled in a shot which Chaouchi dived to palm away.
Just after the half-hour mark, Moteab stretched in the area but could not quite reach a dangerous curling cross from Sayed Moawad.
The key moment came after 37 minutes, when Moteab went down under a challenge from Halliche and referee Codja Koffi gave a penalty. After a lengthy delay, Koffi also produced the red card.
Halliche only had himself to blame as the chance came from his botched clearance.
Hosni converted with the help of a stuttering run-up which incensed Chaouchi, who made a vehement protest to the referee, even seeming to make contact with his head, and was lucky not to be sent off himself.
Moawad had the chance to add a second when he advanced into the area but fired wide with Bougherra paying close attention.
At the other end, Hassan Yebda had a free-kick well saved by El Hadari.
Egypt somehow contrived not to score after 64 minutes when, in a scrappy passage of play, Zidan was among three players to fail to get a decent strike on goal.
But they finally got their second a minute later - and did it in some style.
Zidan was bearing down on goal and, with substitute Hossam Ghaly in support, he turned Belhadj inside out before dispatching the ball left-footed into the far corner.
Belhadj's night then got even worse as he launched a two-footed lunge on El Mohamady and was rightly given his marching orders.
Ahmed Hassan fired into the side-netting, but Abdelshafy came off the bench to add a third with a neat finish from an acute angle.
Chaouchi was belatedly dismissed two minutes from time as he swung his foot at Gedo, who moments later finished past substitute keeper Mohamed Zemmamouche for the fourth.