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'
|France 1 Brazil 3: Dunga´s men maintain winning run|
|Chile 0 Iran 2: Nekounam and Amiri down Copa America hosts|
|Premier League to share over £1bn from record TV deal|
|Morocco v Uruguay: Last chance to impress Tabarez for Copa champions|
|Iran 2-0 Chile: Nekounam and Amiri down Copa America hosts|
|Ivanovic braced for Ronaldo test|
|Bahrain 0 Colombia 6: Falcao stars in comfortable victory|
|Jones to Bournemouth leads loan deadline day moves in Championship|
|Bahrain 0-6 Colombia: Falcao stars in resounding victory|
|Malmo fined for poor pitch by UEFA|
|League Two Preview: Hartlepool aim to continue great escape, leaders Burton host Stevenage|
|France 1-3 Brazil: Neymar on target as Selecao triumph in Paris|
|Bulgaria v Italy: Verratti vows to be Azzurri´s midfield general|
|Kane primed for full England debut|
|Kone receives positive news over knee injury|
|Terry pens new Chelsea deal|
|PSG tie down Marquinhos|
|De Gea stamp was accidental - Skrtel|
|Villa hopeful over Xavi reunion|
|El Salvador v Argentina: Messi set for Roca reunion|
|Ghana v Senegal: Grant´s side looking to rebuild after AFCON disappointment|
|Ferdinand to serve extended touchline ban|
|League One Preview: Duo aiming to inspire Notts County revival, Alexander back at Preston|
|Hodgson keeps an eye on Sterling and Milner|
|Filipe Luis cools talk of Atleti return|
|West Brom to wear retro kit for Leicester clash|
|Netherlands v Turkey: Sneijder unconcerned by key absentees|
|Del Bosque wary of Ukraine threat|
|Israel v Wales: Pivotal fixture for both sides in chase for Euro dream|
|Bosnich backs Villa to beat drop|
|Walcott denies Wenger ´bust-up´|
|Hart: Aguero more difficult to face than Messi|
|Williams: I can´t see myself playing for anyone else|
|Coutinho eager to add more goals to his game|
|Khedira confirms Real exit|
|Messi attends NBA match with Argentina squad|
|United will qualify for Champions League - Bosnich|
|Mexico v Ecuador: Hernandez desperate to play|
|Podolski plays down Germany cameo|
|Bendtner: I could have scored four|
|Leverock family adds to World Cup exploits for Bermuda|
|Pele: ´Impossible´ for Neymar to replace me|
|MLS Preview: New England hoping to end drought|
|A-League Preview: Phoenix without stars for Sydney showdown|
|Klinsmann laments late collapse|
|Premier League clubs post first pre-tax profit for 15 years|
|Vokes relishing chance to link up with Bale|
|Dunga encourages Brazil to entertain|
|Dyke: FA to discuss Hodgson extension|
|Janko eyes history with Austria|
|Wilson urges Begovic to stay put|
|Strachan: Scotland have work to do|
|Sky´s the limit for Australia - Postecoglou|
|Low unhappy with below-par Germany|
|Scotland 1 Northern Ireland 0: Berra´s header settles dour contest|
|Germany 2 Australia 2: Substitute Podolski salvages draw|
|Denmark 3 United States 2: Bendtner hat-trick rescues Danes|
|Scotland 1-0 Northern Ireland: Berra the unlikely hero for hosts|
|Gobbi: Players will ´pay the price´ to keep Parma afloat|
|Rose withdraws from England squad|
|Germany 2-2 Australia: Podolski rescues draw for World champions|
|Denmark 3-2 USA: Bendtner hat-trick wins it for the Danes|
|Nigeria 0 Uganda 1: Late winner sours Enyeama landmark|
|Swaziland 1 South Africa 3: Bafana Bafana back to winning ways|
|Camp Nou to host Copa del Rey final|
|Labadie charged with violent conduct after biting claims|
|Bender keen to rekindle Bayern rivalry|
|Swansea eager to tie down Taylor|
|Varane learning from Real troubles|
|Forster ruled out for rest of season|
|Inter full-back Dodo has successful surgery|
|Verratti focused on future at PSG|
|Minnesota awarded MLS expansion team|
|Ibrahimovic slams ´b******t´ PSG exit rumours|
|Gibson withdraws from Ireland squad|
|Ozil convinced he can win Ballon d’Or|
|Costa: I take a beating from Premier League defenders|
|Canada v Guatemala: Floro seeks to develop winning mentality|
|Vermaelen returns to Barcelona training|
|Euro 2016 Qualifying Preview: Spain face big Ukraine test, Germany visit Georgia|
|Spain v Ukraine: Morata set for first competitive start|
|England v Lithuania: Hart urges Kane not to leave U21s behind|
|Monchengladbach snap up Hannover skipper Stindl|
|Khedira gives strong hint of Real exit|
|Skrtel banned for three matches|
|Brisbane Roar 1 Western Sydney Wanderers 4: Champions´ title defence in tatters|
|Sampdoria swoop for Ajax captain Moisander|
|Barnes: Sterling not ready for big-money move|
|Ferdinand: Ramsey appointment a gamble|
|Ideye hopeful of facing QPR|
|Lampard eyes MLS showdown with Gerrard|
|Ronaldo could face suspension over Clasico celebration|
|Hodgson expects more withdrawals|
|Schalke fans overwhelm Farfan after injury lay-off|
|Swedish third-tier club Dalkurd avoid Germanwings flight|
|Japan v Tunisia: Halilhodzic takes charge of hosts for first time|
|Schweinsteiger brushes aside captaincy pressure|
|Barzagli supports Conte call-ups|
|South Korea v Uzbekistan: Stielike searching for improvement|
|France wary of more balanced Brazil|