Match ends, Morocco 1, Namibia 0.
Namibia forward Iitamunua Keimuine's 89th-minute own goal gifted Morocco victory in their opening Africa Cup of Nations Group D match.
Keimuine misjudged Ajax winger Hakim Ziyech's free-kick as the 2017 quarter-finalists won in Cairo.
Two-time winning coach Herve Renard's side were limited to largely long-range attempts against a Namibia side making their first appearance since 2008.
Ivory Coast face South Africa in Group D's other match on Monday (15:30 BST).
- What's happening on day three at the Africa Cup of Nations?
- What to look out for at this summer's tournament
Despite a starting line-up featuring Ajax player of the season Ziyech, Morocco looked on course for a point against a side ranked 113 in the world - in what is considered the tournament's toughest group.
Nabil Dirar forced Namibia goalkeeper Loydt Kazapua to tip a looping long-range shot over in an uneventful first half, while Nordin Amrabat went down under a challenge by Danzil Haoseb but saw his appeals for a penalty dismissed.
In search of a solution, French coach Renard - who previously triumphed with Zambia in 2012 and Ivory Coast in 2015 - introduced Celta Vigo forward Sofiane Boufal who made a marked difference to the Morocco attack.
The former Southampton man almost made an instant impact, forcing Kazapua to save low to his right, before firing narrowly wide with 10 minutes remaining.
Ziyech, expected to leave Ajax this summer, offered darting runs and trickery but Namibia remained well-organised before suffering a cruel blow as Keimuine's error handed Morocco all three points.
Next, Morocco face Renard's former side Ivory Coast on Friday (18:00 BST), while Namibia come up against South Africa later that day (21:00 BST).
Analysis
by BBC Africa's Matthew Kenyon:
"An average performance, but the most important [thing] is to win three points." Morocco coach Herve Renard summed things up neatly - at the end of a game his team scarcely deserved to win.
It's true the Atlas Lions had most of the possession - and their build-up play was effective at times. But in the final third, it broke down time and time again, to the obvious frustration of players and fans.
The last-minute own goal was so harsh on Namibia - who deserved a point, although they created little. Ivory Coast and South Africa have been warned. Morocco got away with this one, and will surely be keen to do better.
Line-ups
Morocco
Formation 4-2-3-1
- 1Bono
- 17Dirar
- 5Benatia
- 6Saïss
- 2Hakimi
- 18BourabiaSubstituted forBoufalat 58'minutes
- 15Aït BennasserSubstituted forEl Ahmadiat 70'minutes
- 7Ziyech
- 14Boussoufa
- 16N Amrabat
- 19En-NesyriSubstituted forBoutaïbat 78'minutes
Substitutes
- 3Mazraoui
- 4da Costa
- 8El Ahmadi
- 9Boufal
- 11Fajr
- 12Mohamedi
- 13Boutaïb
- 20Idrissi
- 21Abdelhamid
- 22Tagnaouti
- 23Baadi
Namibia
Formation 4-4-2
- 23Kazapua
- 6Horaeb
- 22Nyambe
- 2Haoseb
- 4Hanamub
- 19Shitembi
- 12Ketjijere
- 10StarkeSubstituted forPapamaat 64'minutes
- 7HottoSubstituted forStephanusat 87'minutes
- 11LimbondiSubstituted forKeimuineat 80'minutesBooked at 90mins
- 13Shalulile
Substitutes
- 1Mbaeva
- 3Gebhardt
- 5Hambira
- 8Stephanus
- 9Shilongo
- 14Kamatuka
- 15Papama
- 16Mbazuvara
- 17Keimuine
- 18Gurirab
- 20Kamberipa
- 21Fredericks
- Referee:
- Louis Hakizimana
- Attendance:
- 6,857
Match Stats
- Possession
- Home67%
- Away33%
- Shots
- Home17
- Away3
- Shots on Target
- Home5
- Away0
- Corners
- Home5
- Away0
- Fouls
- Home17
- Away15
Live Text
Post update
Full Time
Second Half ends, Morocco 1, Namibia 0.
Booking
Itamunua Keimuine (Namibia) is shown the yellow card.
Post update
Nordin Amrabat (Morocco) wins a free kick in the defensive half.
Post update
Foul by Itamunua Keimuine (Namibia).
Post update
Nabil Dirar (Morocco) wins a free kick in the defensive half.
Post update
Foul by Itamunua Keimuine (Namibia).
Post update
Foul by Karim El Ahmadi (Morocco).
Post update
Itamunua Keimuine (Namibia) wins a free kick in the defensive half.
Goal!
Own Goal by Itamunua Keimuine, Namibia. Morocco 1, Namibia 0.
Post update
Sofiane Boufal (Morocco) wins a free kick on the left wing.
Post update
Foul by Itamunua Keimuine (Namibia).
Substitution
Substitution, Namibia. Willy Stephanus replaces Deon Hotto.
Post update
Romain Saïss (Morocco) wins a free kick in the defensive half.
Post update
Foul by Peter Shalulile (Namibia).
Post update
Foul by Nordin Amrabat (Morocco).
Post update
Larry Horaeb (Namibia) wins a free kick in the defensive half.
Post update
Offside, Namibia. Lloyd Kazapua tries a through ball, but Peter Shalulile is caught offside.
Post update
Delay over. They are ready to continue.
Post update
Delay in match because of an injury Lloyd Kazapua (Namibia).