Ahly edged a plucky Talae El-Geish side 3-2 on penalties following a 1-1 draw on Saturday to win a record-extending 37th Egypt Cup title and complete their first treble in 13 years.
Fresh from clinching the Champions League title with a dramatic late victory over Cairo rivals Zamalek, Ahly set about winning the remaining major trophy this season and they looked to be cruising when substitute Mahmoud Kahraba fired them in front moments following his second-half introduction.
However, El-Geish, who proved a handful for their illustrious opponents throughout, equalised in stoppage time with a header from substitute Nasser Mansi.
They played both halves of extra time with ten men after defender Ahmed Alaa received a second booking for a high-foot challenge on Marwan Mohsen, but their resolute defending kept Ahly at bay.
It seemed Ahly would enjoy a smooth shootout victory though when Mansi and Khaled Setouhi wasted their spot-kicks, only for Ahly's Ayman Ashraf and Magdi Afsha to also squander their efforts.
Ex-Ahly fullback Hussein El-Sayed stepped up to force a sudden death but he fired against the post, handing his former club the title and denying El-Geish their first ever trophy.
Ahly's hat-trick of titles brought back the glory days of iconic Portuguese coach Manuel Jose, who masterminded the team's only other treble in the 2006/2007 season.
South African coach Pitso Mosimane has also enjoyed his second triumph at the helm, having steered the club to a long-awaited Champions League crown last week.
Ahly can still add two more titles to their trophy-laden cabinet this year as they will face Talae El-Geish again in the Egyptian Super Cup and Morocco's RS Berkane in the African Super Cup.
El-Geish took Ahly by surprise in the first half, adopting a bold approach and pressing their fancied opponents high up the pitch.
They had the ball in the net after eight minutes but the goal was correctly disallowed for offside in the build-up, but it signaled an attacking intent from a team that had never beaten Ahly in any competition.
But such a daring scheme might have been costly though, with Ahly wasting a golden chance to go ahead on 16 minutes when playmaker Afsha, the hero of their Champions League triumph, was picked out unmarked by a square pass from striker Marwan Mohsen, only to see his tame effort saved by keeper Mohamed Bassam.
At the other end, Amr Marei went close for El-Geish with a glancing header that narrowly missed the target following a corner, while Ahly had two half chances through Mohsen and Ali Maaloul in the latter stages of the first half.
The second half was equally exciting, with both sides trading punches in an end-to-end affair.
A clash of heads left Ahly winger Taher Mohamed Taher, who joined from Arab Contractors in the summer, with a serious injury as he made way for Kahraba -- an unscripted substitution that proved fruitful.
Kahraba netted with his first touch after a fine individual effort in the 65th minute, chesting down a flick from the otherwise off-form Mohsen before finding the far bottom corner with a precise angled shot.
Just when Ahly were getting ready to celebrate, Mansi rose above two markers to head in off the bar following a right-wing cross two minutes into stoppage time.
Alaa's dismissal took the wind out of El-Geish's attacking sails but they still managed to restrict Ahly to some tame efforts in extra time, before the Red Devils prevailed on penalties.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)