A double from under-fire striker Amr Gamal sent Ahly to the African Champions League quarter-final following a 3-1 comeback victory over Cameroon's Cotonsport in Alexandria on Saturday.
Needing a win to book a last-eight berth, Ahly dominated the early exchanges but surprisingly fell behind when Cotonsport's Jean-Joseph Kombous struck on the break after 12 minutes to silence around 20,000 fans who were allowed to attend the match at Borg El-Arab Stadium in Egypt's second biggest city.
But Gamal, who is often criticised by the Ahly faithful, soon restored parity with his first Champions League goal in more than a year and veteran playmaker Abdallah El-Said put them ahead after a flowing move in the first half.
Gamal headed home early in the second half to make sure of the victory as record eight-time winners Ahly continue their bid towards their first Champions League title since 2013, with Cotonsport waving goodbye to the competition with six defeats from six matches.
The Red Devils finished second in Group D with 11 points, on level with Zambia's Zanaco but with a better goal difference as both sides are tied in the head-to-head record.
Morocco's Wydad qualified for the quarter-final as the group winners with 12 points after defeating Zanaco 1-0 at home.
Ahly launched an early onslaught, whipping in several crosses from both flanks but they all went begging.
Nigerian forward Junior Ajayi was released by a deft pass from El-Said but blasted his effort over the crossbar after 12 minutes and Ahly were punished moments later.
They were caught by surprise as Cotonsport embarked on a quick counter attack, with Kombous holding off his challenger to volley home a short cross from the right hand side of the penalty area.
Cotonsprot were then pegged back as Ahly relentlessly attacked, bombarding the visitors' goal and slicing open their defence on numerous occasions.
They deservedly leveled the score when Gamal caught out badly-positioned keeper Raoul Armand with a long-range low shot that nestled into the bottom corner on 20 minutes.
El-Said sent the home fans into raptures with a second goal on 33 minutes after a superb three-man move.
His flick found Ajayi on the left, with the Nigerian playing the ball back to El-Said who exchanged passes with Moemen Zakareya inside the area and curled a first-timer into the corner of the net.
It was also one-way traffic in a second half totally dominated by Ahly, who extended the lead with a third goal and were unlucky not to grab a more comprehensive win.
Gamal met an inswinging free-kick from Tunisian left-back Ali Maaloul with a firm header that went past Armand in the 54th minute to complete a rare double and stake his claim for a regular spot in Ahly's starting line-up.
He could have completed a hat-trick when a rebound from a Walid Soliman shot fell into his path but he failed to apply the finishing touch.
Ahly wasted further chances and Cotonsport could have narrowed the gap with 10 minutes remaining when Ronald Wanja's diving free header went just over the crossbar.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)