Aziz Bouhaddouz scored a deciding own goal deep into second-half stoppage time as Morocco suffered a 1-0 defeat to Iran in their first World Cup match for 20 years.
The Morocco striker, who came in in the 77th minute, put Ehsan Haji Safi's free-kick through his own net with a ping header in the 95th minute of the game, leaving no time for a comeback.
Herve Renard's team were well-organised but Morocco extended their record of never having won their opening game in the tournament despite dominating the match and carving out opportunities to score either side of half-time.
Iran's counter-attacking strategy had failed to let them score with Karim Ansarifard and Sardar Azmoun squandering great chances until their wastefulness was rendered irrelevant by Bouhaddouz's late error.