Some local residents blamed the blaze that started on Monday on cannabis growers, who often start small fires to clear the land where they want to grow their crops.
But officials said it was too early to be sure of what caused it.
“The fire claimed around 2000 hectares or 40% of Izarin forest, forcing game animals out of their habitat,” a Forest and Water Commission official said on Friday.
“This was the worst ever forest fire in Moroccan history.”
Hot wind helped the fire spread rapidly but there were no human casualties.
France, Portugal and Spain sent experts to help Moroccan firefighters bring the blaze under control after Rabat called for international help.
“The fire is under control and almost extinguished. We’ll stay in Izarin until Sunday to prevent any mishap,” a senior official of the northern forest and water administration said.
He added that national police were investigating the cause of the fire and acknowledged that cannabis growers had caused several forest fires in the past.
Morocco is Europe’s leading supplier of cannabis with an annual market turnover estimated at 10 billion euros.