In a group that includes two European heavyweights in the form of Spain and Portugal, it was crucial for either Morocco or Iran to secure three points on Saturday evening.
However, the game looked to be edging toward a 0-0 draw until one moment sealed Morocco's fate.
Substitute Bouhaddouz had done well to get infront of an Iran player but instead of clearing the free-kick, the forward directed his header into his own net in the 95th minute.
It was a great header but unfortunately in the wrong goal and it gave Iran a shock 1-0 victory to take them to the top of Group B's standings before Spain face Portugal later - their first World Cup win since 1998.