Nayef Aguerd had the distinction of scoring the 100th goal of the Qatar World Cup but sadly it was into his own net.
However, the Hammer saw his nation move into the last 16 despite that following a 2-1 win over Canada on Thursday afternoon.
Morocco edged past Canada to top Group F and reach the World Cup knockout stage for the first time in 36 years.
Morocco went ahead after just four minutes courtesy of a goalkeeping howler from Milan Borjan.
The north African side doubled their advantage through Youssef En-Nesyri’s well-taken goal as he controlled Achraf Hakimi’s superb pass before firing in.
But sloppy defending gave Canada a route back into the game when West Ham’s Aguerd stuck a boot out to divert the ball into his own net – the 100th goal scored at this World Cup.
Knowing if they avoided defeat they would go through, Morocco were happy to sit back and soak up pressure in the second period.
Their resilience shone through with the Hammers central defender more than playing his part as his team made it two wins and a draw in Group F, and will now face Group E runners-up in the last 16 on Tuesday 6 December.