Egyptians Al Ahly made it through to the African Confederation Cup group phase in dramatic style on the away goals ruling, despite defeat in Morocco.
Ahly, who won the first leg of their play-off against Difaa El-Jadidi 1-0, scored a vital away goal in the dying seconds of the second leg to go through, despite losing the match 2-1.
Egypt international Ahmed Raouf proved to be Ahly's hero with their all-important strike. It was his first goal since joining Ahly last January from Libyan outfit Al-Ittihad and triggered wild touchline celebrations.
Jadidi failed to clear a long throw and the ball was crossed for Raouf to stab it into the net from close range at a packed Stade El-Abdi.
The tie ended 2-2, and meant that Ahly avoided a second continental exit within two months.
Jadidi will rue their missed chances. They began to find holes down the right flank of the Egyptian defence after half-time and exploited them to swing the game in their favour.
A Jadidi player was tripped inside the box as he attempted to connect with a cross and Ahmed Chagou sent Sherif Ekramy the wrong way from the penalty spot.
Gabonese Johan Lengoualama put Jadidi two goals ahead 12 minutes from time when he side-footed another low cross past the Ahly goalkeeper.
However, the hero turned villain by taking off his shirt to celebrate. He was shown his second yellow card of the match by the Tunisian referee and sent off.
Ahly pushed forward in search of a tie-clinching away goal and Raouf repaid a chunk of his transfer fee one minute into stoppage time.
Overall victory was a huge relief for the Egyptians after being eliminated from the Caf Champions League by Libyans Al-Ahly Benghazi last month and demoted to the second-tier Confederation Cup.
Ahly are the most successful African football club with 18 Caf titles, including eight Champions League triumphs, but have fallen on tough times for several reasons.
Stars like midfielders Mohamed Abou Trika and Mohamed Barakat, who made them the dominant African force, have retired while veteran striker Emad Moteab is often injured.
Egyptian security concerns mean no spectators are allowed at domestic matches, depriving Ahly of support and a crucial revenue source. Ahly have also suffered from a lack of match practice in recent years with the last two national leagues not completed because of political upheaval.
Elsewhere, Nigerians Bayelsa United crashed out of the Confederation Cup, losing 3-0 on aggregate to Ivorians Sewe San Pedro.
Bayelsa, who reached the 2009 semi-finals, failed to overturn a 2-0 first leg deficit, with Sewe San Pedro booking their place in the next stage with a 1-0 win in Nigeria.
Bayelsa, the last Nigerian contenders for a Caf trophy this year, could not translate territorial superiority into goals.
The Ivorians snatched an unexpected victory one minute from time when Christian Kouame converted a spot-kick.