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'
|Pochettino to discard three Tottenham players|
|Allardyce: Rooney must wait for captaincy decision|
|Aubameyang: I will only leave Dortmund for Real Madrid|
|Allegri silences questions on Pogba|
|Bruce stands by decision to quit Hull City|
|Pochettino: Not the right time for Argentina job|
|Inter yet to approach De Boer with Mancini exit rumoured|
|Ancelotti trusts me more than Guardiola - Ribery|
|Wijnaldum rejected Everton for Klopp|
|Pre-season Manchester derby cancelled|
|Coutinho excited by ´fast´ Liverpool recruits|
|Cristiano Ronaldo and Conor McGregor step into the ring together|
|Mancini coy on reports linking Icardi to Napoli|
|Nolito reveals why he chose Man City over Barcelona|
|Inter 1 Paris Saint-Germain 3: Icardi absence in defeat fuels Napoli talk|
|MLS Review: Wright-Phillips double inspires Red Bulls to New York derby rout|
|James seeks more game time at Madrid|
|Rooney: I want to be a manager|
|Mignolet welcomes Karius challenge in Liverpool number one battle|
|Batshuayi buoyed by winning vibes at Chelsea|
|Moyes and Sunderland players diverted after plane fault|
|´Loved´ Varane targets long Madrid stay|
|Kostic set for Hamburg medical|
|Leicester crying over Kante sale - Ranieri|
|Schurrle the perfect Mkhitaryan replacement - Tuchel|
|West Ham face anxious wait on Cresswell injury|
|Mourinho will accept criticism from United legends|
|Bertolacci desperate for fresh start after underwhelming first season at Milan|
|Hoops hand Toure one-year deal|
|Origi ready to fight for Liverpool spot|
|Emery wants PSG stay for ´fantastic´ Matuidi|
|No Barcelona offer for Vietto - Cerezo|
|Burnley apologise for racist abuse from supporter|
|Guardiola will not rush Kompany comeback|
|Of course I´ll shake Guardiola´s hand, snaps riled Mourinho|
|Watzke: No more signings for Dortmund|
|Roma expect Manolas to snub Premier League move|
|Adriano set to leave Barcelona for Besiktas|
|Manchester United in worst possible situation - Mourinho|
|Sporting would have to sell stadium to afford Van Persie - Jesus|
|Jonas´ agent confirms Barcelona approach|
|No problem with Mourinho, insists Guardiola ahead of derby in China|
|Toronto´s hat-trick hero Giovinco: I´m back|
|Drogba revels in ´special night´, dedicates hat-trick to family|
|MLS Review: Hat-tricks for Drogba and Giovinco as stars shine|
|Whelan backs Liverpool for top-four finish|
|Pellegrini still waiting for right offer|
|Ronaldo deserves to win Ballon d´Or - Vazquez|
|Phelan wants Hull job|
|Alaba saddened by Gotze exit|
|Morgan: Vardy right to re-sign|
|Maradona ´hurting´ as Higuain closes on Juventus move|
|Moyes watches Sunderland win, Ibe opens account in six-goal Bournemouth thriller|
|Messi cuts short holiday for Barcelona training camp|
|Ranieri still confident of keeping Mahrez|
|Toure to complete Celtic move on Sunday, says Rodgers|
|Vietto sends Simeone a reminder amid Barcelona links|
|Celtic 1 Leicester City 1 (5-6 on penalties): Mahrez magic the highlight as Ranieri´s side triumph i|
|Ribery, Alaba on target in Bayern win|
|Neymar hails Micale ahead of Olympic tilt|
|Ronaldo wants Real Madrid renewal|
|Ochoa joins Granada from Malaga|
|Heidel quashes Meyer to Liverpool as ´nonsense´|
|Scholes challenges Allardyce to change England mentality|
|Tenerife star Crosas investigated for killing endangered shark|
|De Gea: Manchester United can win title under Mourinho|
|Marseille replace Batshuayi with brother Leya Iseka|
|Cristiano Ronaldo: Best season of my career|
|Scholes: Pogba is not worth £100million|
|Gotze has not forgotten how to play football - Riedle|
|Delph learning more than ever under Guardiola|
|Jovetic ´not worried´ about Juventus|
|Allardyce wants Euro 2016 woes to fire his England|
|Giggs not in a rush to take manager´s job|
|Lopetegui: If not for Spain I would be Wolves boss|
|Shaw one of best left-backs in world - Herrera|
|Injured Sanchez to miss Arsenal tour|
|Melbourne Victory 1 Juventus 1 (Melbourne win 4-3 on pens): Thomas inspires Victory as Juve pay pena|
|Janssen: Ajax and PSV were never going to pay as much as Tottenham|
|Bayern to make Munich shooting tributes|
|Wenger wishes luck to old foe Allardyce|
|United defender Varela joins Frankfurt on loan|
|Sunderland appoint Moyes as Allardyce replacement|
|Javi Martinez devastated by Munich shootings|
|Rooney: I´m desperate to play for Mourinho, just like under Ferguson|
|Godin: Champions League the dream, but LaLiga the focus|
|Klopp hails Wijnaldum´s ´football smartness´|
|Klavan ready to fight for starting spot after completing ´dream´ Liverpool move|
|Real Salt Lake 1 San Jose Earthquakes 1: Mulholland salvages point|
|Madeira airport to be named after Cristiano Ronaldo|
|Villar, Ceferin and Van Praag announce UEFA presidential bid|
|Witsel has offers from England and Italy|
|Tuchel will bring out Gotze´s best - Watzke|
|Swansea confirm interest in Liverpool´s Allen|
|Arsenal´s Coquelin: LeBron v Curry is like Messi v Ronaldo|
|Rooney backs Allardyce appointment|
|Bayern and Ancelotti respond to Munich attacks|
|West Brom friendly cancelled over violence concerns|