The Moroccan Football Federation on Thursday complained to world football's governing body FIFA over what it said were a series of refereeing mistakes in their World Cup Group B matches against Portugal and Spain which led to their elimination.

The federation said the "serious referee errors" led to their early exit and that the video assistant referee (VAR) had been used or not used in order to serve the interests of their opponents.

"We want to express our indignation at the injustice suffered by our national team, following serious refereeing errors that led to [the team's] premature exit from the first round of the 2018 World Cup," federation president Fouzi Lekjaa said in a letter to FIFA President Gianni Infantino.

"The severity of these refereeing errors is all the more evident in the fact that in these two matches [against Portugal and against Spain], the use of VAR served only to preserve the interests of our competitors," it said.

Morocco's forward Khalid Boutaib (L) celebrates after scoring the opener during the Russia 2018 World Cup Group B football match between Spain and Morocco at the Kaliningrad Stadium in Kaliningrad on June 25, 2018. OZAN KOSE/AFP/Getty Images

Lekjaa went on to list what he said were three incidents from their 1-0 defeat by Portugal, including Cristiano Ronaldo's fourth-minute winner, which he said should never have counted as a Portugal player had committed a foul.

He also said five decisions from the 2-2 draw against Spain, with his team already eliminated, including the Spanish last-gasp equaliser, had gone against Morocco.

The African side, who also lost their group opener to Iran, had been fuming following their loss to the Portuguese, their second group game, that had killed off their chances of advancing.

"With what has happened we can only express our serious concern at the persistence of these injustices and the negative impact on the image of FIFA and the future of football," he said.

Lekjaa urged Infantino to "take the necessary measures and make the necessary adjustments in order to repair these injustices and guarantee the conditions of a competition with equal opportunities for all teams."