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'
|Mexico v Guatemala: Herrera´s men kick off Copa preparations|
|New Zealand no longer supporting Blatter|
|´Post-World Cup trauma´ affected Mertesacker|
|Racing Club 0 Guarani 0 (0-1 agg): Draw sees Paraguayans through|
|Hamburg shocked by Karlsruher attack - Labbadia|
|Serie A Preview: Napoli, Lazio eye Champions League|
|Hodgson will not overstay England welcome|
|Scholes: United must keep Di Maria|
|Leyton Orient appoint Hendon|
|Benteke has a buy-out clause - Sherwood|
|US Soccer will support Prince Ali in FIFA election|
|Dynamo disappointed with officials after City friendly abandoned|
|Calls for Suarez appeal gather momentum|
|Eredvisie Review: Vitesse denied by late Uth goal, NAC Breda boost survival hopes|
|Rangers 1 Motherwell 3: McCall´s men facing uphill struggle|
|Hamburg 1 Karlsruher 1: Bundesliga side escape with draw|
|Blatter vows to lead FIFA clear of trouble as corruption scandal rolls on|
|Bundesliga: Bayern Munich season review - League crown not enough to signal successful campaign|
|Genoa forced to wait for UEFA licence|
|Injured Cardozo out of Paraguay squad|
|CONCACAF provisionally dismisses Webb and Li|
|Klopp: Career highlights of a charismatic coach|
|Verona v Juventus: Ogbonna seeks strong Champions League warm-up|
|FA charges Demetriou over betting breaches|
|Atalanta v Milan: Inzaghi faces last chance to prove worth|
|King joins Bournemouth as QPR rebuild begins|
|Plymouth part ways with Sheridan|
|Hernandez banned for three matches|
|Chelsea star Fabregas has nose surgery|
|Blatter: More bad news may follow|
|Galliani hopeful over Ancelotti deal|
|Frontzeck to continue as Hannover coach|
|Tremmel released as Tate waves goodbye to Swansea|
|Arsenal v Aston Villa: Sherwood out to upset holders|
|UEFA open to boycott of World Cup - Platini|
|Porto activate release clause for Casemiro|
|Athletic Bilbao v Barcelona: Catalans seeking second leg of treble|
|Auxerre v Paris Saint-Germain: History beckons for Ligue 1 champions|
|Cole confirms West Ham departure|
|UEFA elect not to boycott FIFA Congress|
|Borussia Dortmund v Wolfsburg: Klopp aiming for triumphant farewell|
|Flamini hails Coquelin impact at Arsenal|
|South Africa deny wrongdoing in World Cup bid|
|Benitez confirms Napoli exit|
|McShane among six released by Hull|
|Cerci committed to Milan|
|West Ham expect Collins to return for pre-season|
|Real deny Pogba bid|
|Important to keep Chelsea squad together - Mourinho|
|Alonso: Gerrard was magic|
|Pochettino silent on Ings speculation|
|Visa threatens to ´reassess´ sponsorship amid FIFA scandal|
|Blatter skips FIFA Medical Conference|
|MLS Preview: Revs not out for revenge against Galaxy|
|MLS Review: Sounders go top in West, Timbers and Galaxy win|
|AFC stands by Blatter|
|Matheus ´alright´ after collapse - Markevych|
|Copa Libertadores Review: River, Inter through to semis|
|Signing Toni a ´long shot´ for Adelaide|
|Ramsey good enough for Barca - Coleman|
|Bacuna pushing for Benteke stay|
|Evans stunner settles City friendly in Toronto|
|Banega: Emery a great coach|
|Emery tight-lipped on Sevilla future|
|Argentina finalise Copa America squad|
|Nike issues statement following arrest of FIFA officials|
|Hero Bacca grateful for Europa League triumph|
|Markevych rues defensive errors in Dnipro defeat|
|AFC Champions League Review: Naft Tehran fairytale continues|
|Emery: We deserved Europa League success|
|Dnipro 2 Sevilla 3: Bacca brace sees holders make history|
|South Africa 0 Malawi 0 (4-5 on penalties): Harawa heroics send Bafana Bafana out|
|CONCACAF and CONMEBOL respond to arrests in FIFA scandal|
|FIFA president Blatter welcomes investigations as corruption probe rocks world football|
|UEFA calls for FIFA elections to be postponed|
|BREAKING NEWS: Advocaat exits Sunderland and retires from club management|
|La Liga: Real Madrid season review - Ancelotti pays the price for disappointing season|
|Zambia 3 Ghana 0: First-half spree does the damage|
|Barnes suffers double knee ligament injury|
|Balotelli to stay at Liverpool - agent|
|Kane at the double in friendly win|
|Norwich make Dorrans switch permanent|
|Ings unsure of next move|
|Bournemouth snap up Federici|
|FIFA ´crisis´ cannot continue - Prince Ali|
|Barton headlines QPR exits|
|Juan demands more from Inter|
|Stoke snap up Haugaard|
|Subotic commits to Dortmund|
|Warner pleads innocence after US indictment|
|Napoli to refuse questions on Benitez´s future|
|USDoJ names indicted FIFA officials|
|Wenger coy over Vidal and Benzema moves|
|Suarez back in training ahead of Copa final|
|Pique: I´ll retire at Barca|
|Gerrard ´blown away´ by Liverpool send-off|
|FIFA ´very happy´ with Zurich arrests|
|Liverpool defender Toure targeting trophies|
|Ramsey eyeing title assault|
|Welbeck out of FA Cup final and England matches|
|FIFA the ´injured party´ as Swiss prosecutors open criminal proceedings|
|Prince Ali saddened by FIFA arrests|
|Pellegrini to make City defence a priority|
|Labbadia giving Lasogga, Olic, Jiracek time|
|Ramsey confident on Wembley chances|
|Swiss authorities confirm FIFA arrests|
|El Shaarawy open to Premier League move - agent|
|Reports: FIFA officials set to be arrested|
|Tigres UANL 2 Emelec 0 (2-1 agg): Mexicans through to Libertadores semis|
|Valencia ruled out of Copa America|
|Coleman: Bale being ignored by Real team-mates|
|Ruddy eyes England recall|
|Benteke will strike fear into Arsenal - Westwood|
|Howe named LMA Manager of the Year|
|Casillas reiterates desire to stay in Madrid|
|Dnipro players pay for fans´ tickets, transport|
|Galliani: I want Ancelotti back at Milan|