Magdy struck as stoppage time loomed behind closed doors because of the coronavirus pandemic after Amr el Soleya had given Ahly an early lead and ‘Shikabala’ scored a magnificent equaliser before half-time.
With 85 minutes gone, Magdy controlled the ball with his knee outside the area and hammered it into the net to earn Ahly a record-extending ninth Champions League title and first since 2013.
The climax was in keeping with a thrilling final that completed a competition which began in August last year and was constantly delayed by Covid-19.
Success for Ahly meant South African Pitso Mosimane became only the third coach after Argentine Oscar Fullone and Egyptian Mahmoud el Gohary to win the Champions League title with two clubs.
Mosimane guided Mamelodi Sundowns of South Africa to a 3-1 aggregate victory over Zamalek in the 2016 title decider.
Before the kick off in a stadium that would normally be packed to its 74,000 capacity for a Cairo derby, both teams observed a moment of silence in honour of Argentine icon Diego Maradona, who died on Wednesday.
Ahly took a fifth-minute lead when Amr el Soleya rose to powerfully head a corner kick into the net after goalkeeper Mohamed Abou Gabal had conceded the set piece under pressure from Hussein el Shahat.
Boosted by the dream start, the Cairo Red Devils use both wings to keep the White Knights under pressure in the first Champions League final featuring clubs from the same country.
When Zamalek did push forward they were no match for an Ahly defence that conceded just six goals in 14 matches en route to the final.
Memorable solo goal
But any disappointment Zamalek supporters experienced as they watched the match live on national television disappeared after 31 minutes thanks to ‘Shikabala’.
One of many Egyptian footballers who favour a nickname over their official name, in his case Mahmoud Abdelrazek Hassan Fadlala, ‘Shikabala’ levelled with a memorable solo goal.
Receiving possession on the touchline, he burst between two Ahly defenders, took the ball across another, then smashed a left-foot shot into the roof of the net.
Ahly goalkeeper Mohamed el Shennawy barely moved such was the power and speed of a shot that produced one of the greatest goals in the 55-year history of CAF Champions League finals.
Under the cosh for much of the opening half, Zamalek would have been the happier team trooping off the pitch at half-time in a contest living up to its billing of the ‘derby of the century’.
Ahly should have regained the lead eight minutes into the second half but El Shahat hits a post with an unguarded goal in front of him and Mahmoud Ibrahim cleared.
The woodwork came into play again midway through the half, this time preventing Zamalek taking the lead as Ahmed ‘Zizo’ Sayed watched his shot cannon off a post.
As the frantic pace inevitably slackened, El Soleya was yellow carded for fouling Sayed and Zamalek had a penalty appeal rejected by the Algerian referee.
Then, after 54 minutes with the sides equal, Magdy scored his third goal of the African campaign to give Ahly a record-extending 20th CAF title.