Morocco started the game on the front foot but were lucky to go in level at the break as Rubin Kazan striker Sardar Azmoun broke in behind for Iran but could only aim his shot too close to Munir Mohamedi, who then did well to keep out Alireza Jahanbakhsh's strike from the rebound.

That chance seemed to give Iran belief that they could get a result at the Krestovsky Stadium, something that came to pass as substitute Bouhaddouz sent a bullet header past his own goalkeeper in the dying embers of the game.

"After so many years in this business, the first game of a World Cup is always difficult and tough and this was no different - but it was also beautiful," Iran coach Queiroz said of the country's second World Cup win.

"We started very carefully and I'm sure they studied the Iranian team, we knew they have a very strong and powerful start to the game - always with full speed and a great attacking spirit.

A general view of Saint Petersburg Stadium after the match Photo: Getty

"Our strategy was, from the first minute, to create a mental collapse in the Moroccan players, we try to do that by creating frustration and block all the playmakers and the players who can create something."

With European heavyweights Spain and Portugal the other nations in Group B, any chances of Iran or Morocco providing a shock and reaching the knockout stages looked like needing a positive result here.

Portuguese Queiroz takes Iran to Kazan to face Spain next time out and admits a different approach is required.

"Since we were able to create panic in their defensive line the game changed," he said.

"The players for Morocco knew we could win the game and that changed everything in the last minutes. It was a beautiful win, three points, and now it is time to rest and think about the game against Spain."