Raja Casablanca survived a scare to defeat Auckland City 2-1 and qualify for the quarter-finals of FIFA's Club World Cup on Wednesday.
The Moroccan outfit - playing in their home country - were heavy favourites and dominated the first half at Stade d'Agadir.
They took a deserved lead in the 39th minute when Mouhssine Iajour atoned for an earlier miss with a stylish left-foot finish.
Fijian Roy Krishna shocked Casablanca by pouncing on a horrendous defensive error to level just after the hour mark, but Abdelilah Hafidi spared the blushes of the hosts with a close-range finish in the 92nd minute.
Casablanca will now play North American champions Monterrey of Mexico in the last eight.
Casablanca - the only side involved in the tournament who are not champions of their continent - entered the match on the back of a four-match winless run domestically.
They were buoyed by a partisan home crowd against amateur outfit Auckland City – winners of the OFC Champions League – and started brightly, with Adil Karrouchy volleying an excellent cross from captain Mohsine Moutaouali over in the seventh minute.
Iajour was sent through on goal in the 22nd minute but had his effort saved by the outstretched leg of Auckland goalkeeper Tamati Williams.
He made amends six minutes before half-time though, as a Karrouchy ball played him in.
Iajour beat Auckland skipper Ivan Vicelich before shooting past Williams from a tight angle.
Casablanca nearly had a second three minutes into the second half, with another excellent Karrouchy ball headed behind by John Irving, but dropped back after that and allowed Auckland into the match.
Christopher Bale shot wide before a smart Issam Erraki intervention kept out Krishna from a clever free-kick.
Auckland did level proceedings in the 63rd minute, as a dreadful defensive mix-up – which saw three players fail to clear and Mohamed Oulhaj and Karrouchy tackle each other – allowed Krishna in.
The forward kept his composure to slot past the onrushing Khalid Askri from outside the penalty area and his goal spurred Auckland on.
They started to have more of the ball and Krishna proved a continued threat, but a late Casablanca attack ended Auckland's hopes of reaching the quarter-finals.
The influential Karrouchy supplied the cross and, although Oulhaj's header was well saved by Williams, Hafidi was on hand to send the home crowd into raptures.
|3||Z. El Hachimi|
|Coach: F. Benzarti|
for C. Chtibi 74'
for M. Iajour 85'
for A. Hafidi 90+4'
|Klopp upbeat despite late equaliser|
|Cech: We can be best ever Chelsea side|
|Newcastle face goalkeeper crisis ahead of derby|
|Werder Bremen v Borussia Dortmund: Bundesliga stugglers targeting morale-boosting win|
|Medellin 1 Santa Fe 2: Visitors fight back to win|
|Barcelona 1 Emelec 1: Ecuadorian Primera A Third Stage play-off evenly poised|
|Sporting Cristal 0 Juan Aurich 0: Third leg required to decide Peruvian champions|
|Bauza ´delighted´ after San Lorenzo reach final|
|Paris Saint-Germain v Montpellier: PSG look to build|
|Bundesliga Preview: Bayern seeking to extend unbeaten start before winter break|
|Contra, Michel join Guangzhou R&F|
|Naismith signs Everton extension|
|Palestino 3 Santiago Wanderers 1: Title drought almost over for hosts|
|Copa del Rey Review: Finnbogason breaks drought in Sociedad win|
|Coupe de la Ligue Review: PSG scrape into quarters, Lille, Monaco win on penalties|
|Worcester City 1 Scunthorpe United 1 (aet, 13-14 on pens): League side narrowly avoid shock|
|Stambouli hails ´perfect´ Tottenham|
|Goals win games - Pardew|
|Bundesliga Review: Dortmund held by late equaliser, Leverkusen beat Bremen|
|PSV 4 Feyenoord 3: De Jong hat-trick helps settle thriller|
|Rodgers hails ´brilliant´ Liverpool|
|Eredivisie Preview: Leaders PSV take on struggling Eagles|
|Madoui hails second-half display|
|Championship Preview: Reading´s Clarke era begins at Watford|
|Liverpool to meet Chelsea in League Cup semi-finals|
|San Lorenzo 2 Auckland City 1: Extra time required to book Real final|
|AC Ajaccio 1 PSG 3: Late show sends holders through|
|Bournemouth 1 Liverpool 3: Sterling brace helps ease pressure|
|Tottenham 4 Newcastle United 0: Pochettino´s men march into semi-finals|
|Borussia Dortmund 2 Wolfsburg 2: Naldo denies Klopp´s strugglers|
|League Two Preview: Moore looks for fighting spirit, Accrington aim to bounce back|
|Allegri has suspension overturned|
|ES Setif 2 Western Sydney Wanderers 2 (5-4 on pens): Algerians rely on penalties to finish fifth|
|Ligue 1 Preview: Fournier not expecting to claim top spot, Marseille entertain Lille|
|Indian Super League Review: Kerala through to face Kolkata in final|
|Lasogga suffers thigh strain|
|Michael Garcia FIFA resignation notice in full|
|Bayern draw not ideal - Lucescu|
|Garcia resigns from FIFA role|
|Mainz v Bayern Munich: Bavarians on brink of more records|
|Garcia to fight two-match ban|
|Green backs Mignolet to return stronger|
|Mandzukic and Koke to lead inexperienced Atleti XI|
|Fonte apologises to fans after cup defeat|
|Metz suspend Maiga after unauthorised absence|
|Agent: Cole settled at Roma|
|Bayern duo sign new deals|
|Allegri calls for Juve focus ahead of Cagliari trip|
|Pearson accepts FA charge after fan row|
|Mourinho rules out January signings|
|Schaars set for PSV absence after knee surgery|
|Traore wants more Barca chances|
|Hamann hopes Liverpool receive cup boost|
|Lukaku wants Everton to produce Premier League best in Europe|
|La Liga Preview: Barca host Cordoba, Atletico travel to Bilbao|
|A-League Preview: Berisha crucial for Milligan-less Victory|
|Tena: Real ´by far the better team´|
|Blanc avoids Mourinho mind games, hails retiring Henry|
|Hecking convinced Dortmund remain dangerous|
|United´s Jones insists injuries are behind him|
|Henry: Managing Arsenal is my dream|
|Hard to imagine a better performance - Luis Enrique|
|Copa del Rey Review: Goals rain in Spain|
|Benatia to sit out Mainz clash|
|Koeman slams ´disrespectful´ Sheffield United|
|Barcelona 8 Huesca 1 (12-1 agg): Pedro treble sets up big win|
|Coupe de la Ligue Review: Nantes come from two down, Bastia knock out Caen|
|Penalty save was key, says Ancelotti|
|Mourinho pleased with professional approach in Derby win|
|FA Cup Review: Yeovil set up Man United clash, Tranmere to face Swansea|
|Bundesliga Review: Stuttgart move off bottom, Bayern win again|
|Sheffield United 1 Southampton 0: McNulty secures semi-final spot for third-tier side|
|Derby County 1 Chelsea 3: Premier League leaders progress|
|Cruz Azul 0 Real Madrid 4: Spanish giants cruise into final|
|Bayern Munich 2 Freiburg 0: 100 not out for Robben as champions cruise|
|Cagliari v Juventus: Barzagli unconcerned by successive draws|
|ECA and EPFL make case for May World Cup in 2022|
|Atletico Madrid v L´Hospitalet: Simeone likely to rotate|
|Serie A Preview: Morata chasing goals, Roma host Milan|
|Hartlepool appoint Moore following takeover|
|Parma appoint new president|
|Garcia handed two-match ban|
|Reading appoint Clarke to replace Adkins|
|Conte rules out resignation|
|Adebayor will not face Newcastle - Pochettino|
|Zhang seals Wolfsburg switch|
|SFA rejects Tonev appeal|
|Garcia report appeal rejected by FIFA|
|Herrera denies involvement in match-fixing|
|Thierry Henry: Moments that defined a genius|
|UEFA opens proceedings against Celtic|
|Rodgers denies talk of dressing-room rift|
|Jonas will be given a chance - Pardew|
|AFC asks Australia to increase security for Asian Cup|
|D´Ambrosio sets Inter sights on third|
|Williams wants Swansea to share goalscoring burden|
|Saudi Arabia appoint Olaroiu|
|Martinez lauds Barkley|
|Thierry Henry announces retirement|
|Rooney: United can win title|
|ES Setif v Western Sydney Wanderers: Topor-Stanley to miss fifth-place play-off|
|Beasley calls time on international career|
|Tena: We expect to face Real´s best|
|Martinez wary of Young Boys´ artificial pitch|
|Dudek: Everyone under pressure at Liverpool|
|Martinez hails ´devastating´ attack|
|Redknapp: QPR´s road woes more than bad luck|
|Defeat harsh on QPR - Redknapp|