A late own goal by Morocco substitute Aziz Bouhaddouz helped Iran win its first match at a World Cup finals since 1998.
Bouhaddouz put the ball into his own net with a diving header at the near post in the 95th minute as Morocco defended a left-wing free-kick.