Marsa Maroc manages container terminals at 9 Moroccan ports and is listed at the Casablanca stock exchange.
The deal will inject some 5.48 billion dirhams in state coffers which will help a Covid-hit budget deficit expected at 6.3% this year.
Morocco has launched a program to overhaul state-held enterprises through privatization, mergers or dissolution. The government has also created an agency to oversee state-owned enterprises with the aim of improving efficiency and profitability.
Tanger Med port outpaced all Mediterranean peers last year by handling 5.8 million containers.