Morocco had by far the better of the chances before Aziz Bouhaddouz’s own goal handed victory to Iran.
Aziz Bouhaddouz scored a calamitous own goal deep into second-half stoppage time as Morocco slipped to a 1-0 defeat to Iran in their first World Cup match for 20 years.
The late drama sparked wild celebrations from the Iran bench in St Petersburg as Carlos Queiroz’s side took three points from a game in which they were second best for long periods.
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 bear fruit with Karim Ansarifard and Sardar Azmoun squandering great chances until their wastefulness was rendered irrelevant by Bouhaddouz’s late error.
The Morocco striker, on as a substitute in the 77th minute, put Ehsan Haji Safi’s free-kick through his own net with a diving header in the 95th minute of the game, leaving no time for a comeback.
While Iran celebrated, Morocco faced up to the daunting reality of going into their remaining Group B games against Spain and Portugal with no points on the board.
Morocco, competing at the World Cup finals for the first time in 20 years, started positively and Amine Harit fired wide with a volley from the edge of the penalty area after two minutes.
Younes Belhanda headed past the post from Nordin Amrabat’s cross shortly after as Morocco found their way behind the Iran defence with ease, before Ayoub El Kaabi failed to test Alireza Beiranvand in the Iran goal when he swung wildly at a chance from 18 yards.
The pressure on Iran was almost relentless, with Belhanda and captain Medhi Benatia squandering close-range chances in a penalty box scramble before Iran finally countered after 20 minutes, only for Karim Ansarifard to scuff his shot when clean through on goal.
Harit’s neat footwork took him into the box and he drew a save from Beiranvand with a side-footed shot as Morocco continued to press.
The best chance of the first half fell to Iran’s Sardar Azmoun, though, who bore down on goal after latching onto Omid Ebrahimi’s throughabll, but his shot was too low and Munir Mohamedi saved low with his feet.
Amrabat continued to make inroads down the right flank for Morocco after the interval while their efficiency and organisation at the back cut out Iran’s counter-attacks before they reached the final third.
With just under 20 minutes left on the clock, Amrabat fell awkwardly when challenging for the ball and the wing-back was left so dazed that he had to be replaced by his younger brother, Sofyan.
Morocco pushed for a winner in the final 10 minutes and Hakim Ziyech lashed the ball towards the bottom-left corner of the net from 20 yards but Beiranvand pulled off a smart stop.
And it proved an even more important save when Iran forced a free-kick wide on the left in the closing seconds and Safi’s delivery was met by a thunderbolt of a header from Bouhaddouz that flew into the left corner of the net, undoing Morocco’s hard work and leaving them with a mountain to climb to stay in the World Cup.