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'
|Rivals scared of Ibrahimovic, says United team-mate Herrera|
|Schmeichel pays tribute to Ranieri|
|Yaya Toure wants to play with Neymar and Coutinho|
|Mourinho: It´s more difficult to win now|
|I didn´t sleep for six days – Conte motivated by last-gasp title loss|
|It all depends on success - Klopp knows trophies are a must|
|Barkley targets finishing above Liverpool|
|Championship Review: Birmingham ease pressure on Zola with derby win|
|Mourinho could start Rooney in EFL Cup final|
|Comeback kid Le Bihan moves Nice level with Monaco|
|Leicester job an amazing opportunity - Rowett pitches to replace Ranieri|
|Deschamps free to pick Benzema, Le Graet reveals|
|Valencia request new time for Barcelona fixture|
|Rabona-fide brilliance! Watch Kovacic´s marvellous strike in Real Madrid training|
|Hull´s Silva cools Hernandez CSL rumours|
|Frustrated Allardyce accepts Palace players are struggling|
|Sampaoli tells Sevilla to learn from Real Madrid errors in ´most important game of the year´|
|Raiola ready to cut off Balotelli´s tongue after latest red card|
|My dream died after Leicester sack - Ranieri|
|Schalke sign Bentaleb from Tottenham|
|Puel welcomes Mkhitaryan´s EFL Cup final absence|
|Arsenal chairman concedes Gunners are playing for pride against Bayern|
|Melbourne City 1 Sydney FC 3: Bobo double helps leaders back to winning ways|
|Kohler refuses to write off Gotze|
|Ranieri will be remembered in 2,000 years, says Mancini|
|You don´t owe anyone - Henry tells Rooney to make China move if it makes him happy|
|I was not an Italian spy! - No ulterior motive for Conte in Eddie Jones meeting|
|Inter coach Pioli expects tight Roma clash|
|Mourinho: Leicester should name stadium after Ranieri|
|Conte: Ancelotti the best Italian coach in the world|
|Carrick in, Mkhitaryan out for Manchester United in EFL Cup final|
|Klopp compares Ranieri sacking to Trump, Brexit triumphs|
|Ranieri did not lose Leicester dressing room, insists Shakespeare|
|Conte willing to risk sack to lead Chelsea to Premier League glory|
|Disapponting for managers around the world - Premier League bosses react to Ranieri sacking|
|Ribery ready for Bayern Munich comeback|
|Celtic fined for Manchester City crowd trouble|
|Vardy´s goal decline and Mahrez´s assist struggles: The Opta stats behind Ranieri´s Leicester demise|
|Bayern boss Ancelotti vows never to repeat middle finger gesture|
|Medel urges Sanchez to quit Arsenal for Inter|
|Europa League draw: Manchester United to play Rostov, Lyon v Roma|
|Aubameyang dry spell worries me - Tuchel|
|Varane a doubt for Napoli as Real Madrid confirm muscle injury|
|Leicester job favourite Mancini: I am sorry for my friend Ranieri|
|Allegri welcomes back Bonucci following apology|
|Montella targets lengthy AC Milan stay|
|Lineker cries after Ranieri is sacked|
|Ranieri sacking ´the biggest shock in a decade´|
|Wenger ´witch-hunt´ has gone too far, says Bilic|
|Lewandowski better than Benzema, Suarez, Costa - Matthaus|
|Sticks and Stones may break my bones - Man City defender unhurt by criticism|
|Atletico Madrid v Barcelona: Simeone´s men primed to land on punch-drunk Barca|
|Pogba no machine like Messi or Ronaldo, says Mata|
|Oxlade-Chamberlain adamant Arsenal ´more than capable of competing for title´|
|Monaco star Falcao was almost lost to baseball|
|FC Dallas 4 Arabe Unido 0: Champions League semis beckon for Americans|
|No gratitude in football - Spalletti saddened by Ranieri sacking|
|Alli not to blame for Tottenham´s Europa League exit - Pochettino|
|Mourinho pays tribute to axed Leicester boss Ranieri|
|Europa League Review: Spurs crash out, Stindl stuns Fiorentina, Lyon destroy AZ in record-equalling|
|Bastia punished over Balotelli abuse|
|Eriksen blames Tottenham´s shock Europa League exit on poor finishing|
|Ranieri sacking a brutal reminder of football´s necessary lack of sentiment|
|Tottenham 2 Gent 2 (2-3 agg): Alli sent off as Kane own goal sends Spurs out|
|Jokanovic signs new Fulham deal|
|Serie A top three setting ´incredible´ pace, says Eder|
|Ranieri sacked by Leicester City|
|Coutinho: Klopp lets us do whatever we want|
|Lampard to be honoured with Chelsea tribute|
|Bolasie set for second knee surgery|
|Rooney rejects Chinese fortune to stay at United|
|Falcao has silenced his critics - Jardim|
|Clement backs Mawson to shackle Chelsea stars ahead of ´special´ Stamford Bridge return|
|Happiness more important than money - Bacca rejects new China approach|
|Lewandowski the perfect number nine, says Jancker|
|Digne tips PSG for fifth consecutive Ligue 1 title|
|Cedric thinks Euro 2016 final will help against Manchester United|
|Infantino praises progress on Qatar 2022 worker conditions|
|Manchester United have strength in depth to win quadruple, says Young|
|Ibrahimovic on PSG´s Barca victory: Win or lose, they talk about me|
|Robbery, Thiago irreplaceable at Bayern - Matthaus|
|Griezmann will ´definitely´ join Manchester United, claims Petit|
|Manchester United selling Rooney now would be odd - Neville|
|Rooney named China´s fifth most popular player, Ronaldo on top|
|Payet always loved Marseille - Digne|
|Arsenal midfielder Cazorla set to miss rest of season|
|Alba wants Isco at Barcelona|
|Bilic worried injuries will derail Carroll´s England hopes|
|Aguero ability was never in doubt for Fernandinho|
|Nani thigh injury tempers Valencia´s Real Madrid joy|
|Matip confident Liverpool will make top four|
|Rooney still has the quality to play in Europe, says Bilic|
|Koscielny wants Wenger to stay at Arsenal|
|Pogba record will soon be broken - Kahn|
|Ramos hurting but calm after Real Madrid´s Valencia setback|
|De Boer would love to manage in the Premier League|
|Wenger criticism is impossible - Nasri defends embattled Arsenal boss|
|It´s good to talk - Sagna urges better communication from Manchester City defence|
|CONCACAF Champions League Review: Vargas scores as Tigres UANL are held|
|Jovetic: We were much better than Leicester|
|Victory star Berisha set to debut for Kosovo|
|Pjaca keen for more chances after first Juve goal|
|Allegri hails ´champion´ Alves|
|´Going to China? Madness´ – Keane urges Rooney to stay in Europe|
|Nuno rues Telles red as Porto retain hope|
|Socceroos to host Brazil in Melbourne|
|Sampaoli rues Schmeichel heroics|
|Sevilla president unimpressed by ´unjust´ winning margin|
|Allegri praises Pjaca for attitude change|