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'
|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|
|Allardyce ´cannot stop smiling´ after getting England job|
|Rakitic dismisses Barcelona exit talk|
|Oxlade-Chamberlain salvages draw for Arsenal in opening friendly|
|Bruce leaves Hull City by mutual consent|
|Juventus start Serie A title defence against Fiorentina|
|Guardiola already making impact at Manchester City - Clichy|
|Liverpool sign Netherlands international Wijnaldum|
|Ranieri: Chilwell, Ulloa going nowhere|
|Batshuayi: Conte already making me a better player|
|Allardyce determined to be the best - Davies|
|Wolfsburg sign Mayoral from Real Madrid|
|New coaches the attraction in USA/Europe Champions Cup zone|
|´It was like F1 v F3´ - Mourinho not making hasty judgments on United squad|
|Suarez would welcome Vietto with open arms at Barcelona|
|Glenn hails ´ideal candidate´ Allardyce|
|Juventus begin ICC campaign amid Pogba furore|
|Sunderland look to move forward after Allardyce departure|
|Kuyt backs Wijnaldum for Liverpool success|
|No major trophies, fewer goals than Moyes - the stats behind England boss Allardyce´s career|
|Hayden was wasting his career at Arsenal - Wenger|
|New recruits excite Aubameyang after United rout|
|Allardyce the right man to take England back to basics|
|Solve the Rooney puzzle and restore Sterling´s confidence: Five problems for Allardyce to solve|
|England appoint Allardyce as manager|
|Manchester United 1 Borussia Dortmund 4: Classy BVB hand Mourinho first defeat|
|James vows to stay at Real Madrid|
|Caught in a jam - Minnesota ´explain´ goalkeeper gaffe|
|Clarke nominated for FA chairman|
|Gazidis expects more Leicester-style Premier League triumphs|
|Arsenal snap up Bolton defender|
|Alex the Mann for Liverpool as veteran seals Anfield move|
|Dortmund sign Schurrle on five-year deal|
|Balotelli needs right opportunity - Raiola|
|Lukaku undergoes Lazio medical|
|Suarez: Messi better than Ronaldo by far|
|Allegri remains hopeful of Pogba Juve stay|
|Rakitic´s agent questions Barcelona midfield buys|
|Shearer: England players must respect Allardyce or walk|
|Raiola: I don´t give a damn if Pogba costs a world-record fee|
|Mazinho dreams of Thiago-Rafinha reunion at Barca|
|No heart, no gold says ex-Brazil striker Elber|
|There is space for Mata at United - Mourinho|
|Alonso: Guardiola needs time to improve City|
|Argentina approach Bauza to be coach|
|Inter still ´under construction´ - Ranocchia|
|Mourinho: Rooney will be an important player|
|Ganso prepared for the step up to European football|
|Dyke: Brexit could help England|
|Galatasaray confirm Lucas interest|
|Conte targets Champions League with Chelsea|
|Swansea style attracted new owners Kaplan and Levien|
|Mourinho not concerned if United fail to sign Pogba|
|Mourinho teased Ibrahimovic into United move|
|Hearts suffer embarrassing Europa League exit to Birkirkara|
|Barca agree deal for Valencia midfielder Gomes|
|Kerzhakov extends Zenit stay|
|Long delight at new Southampton contract|
|Batshuayi opens Chelsea account in friendly thrashing|
|No revolutions for Portugal - Santos|
|Shaw feared career was over after leg break|
|Rondon, McManaman see West Brom to Vitesse victory|
|International Champions Cup: Guardiola and Mourinho take phony war to China|
|Marcelo hopes Ronaldo returns for Super Cup|
|Lopetegui pledges to honour Del Bosque legacy|
|Del Bosque backs Lopetegui to ´take Spain forward´|
|Juve complete €23m Pjaca signing|
|Bolt backs Mourinho for United success|
|Van Persie sale out of the question, say Fenerbahce|
|Watford bring in Dja Djedje from Marseille|
|Barcelona confirm Hamburg switch for Halilovic|
|Wimmer signs new Tottenham deal|
|Walsh leaves Leicester to become Everton director of football|
|Gotze has taken the hard path back to Dortmund - Tuchel|
|Halilovic completes Hamburg medical|
|Phase out Casillas, make Morata the main man and five key issues facing new Spain boss Lopetegui|
|Lots to come from Arsenal newcomer Xhaka, says Wenger|
|City-United clash threatened by storm|
|Lopetegui named new Spain coach|
|Pogba agent denies done deal with United|
|Song set to join Rubin Kazan|
|Real Madrid return ´a dream come true´ for Morata|
|Barcelona on the lookout for a striker - Luis Enrique|
|Icardi happy at Inter amid Arsenal rumours|
|Luis Enrique: I´m not worried about Messi|
|Mourinho keen to ´support´ Allardyce as England boss|
|Dybala in the dark over ´great friend´ Higuain´s Juventus move|
|Mourinho confident United will find right players amid Pogba talk|
|Gotze admits Bayern regret upon return to Dortmund|
|Suits you sir - Mourinho highlights tailored approach to Ibrahimovic pre-season|
|Dyke: FA board will back Allardyce as England boss|
|Eriksson: Allardyce will do a good job for England|
|Barcelona priced out of Pogba move|
|Ba eyes March comeback|
|Mourinho has to make United feared again, says Beckham|
|Klopp praises goalkeeper George after outfield cameo|
|Cicinho reveals manipulating Madrid stars|
|Independiente del Valle 1 Atletico Nacional 1: Mina salvages late draw in first leg|
|Shaw ready for crucial China tour|
|Ibe makes Bournemouth bow in friendly rout|
|Tuanzebe thrilled with Mourinho praise|
|Udinese snap up De Paul from Valencia|
|Conte reveals thinking behind Batshuayi bow|
|Angelino hungry for more after impressing|
|Petrov offered non-playing role at Villa|
|Klopp refuses to discuss Allen exit rumours|
|Morgan urges Mahrez to stay with Leicester|
|Ancelotti: Allianz bow was like first day at school|
|Conte happy for England-bound Allardyce|
|City ´don´t have many possibilities´ to get Sane – Guardiola|