Morocco has threatened to pull its soldiers out of UN global peacekeeping missions in a row over the disputed territory of Western Sahara.
It is furious with UN Secretary-General Ban Ki-moon after he used the term "occupation" about the territory, which was annexed by Morocco in 1975.
The foreign ministry also said it would immediately cut funding and personnel for the UN Mission in Western Sahara.
Up to a million Moroccans protested in the capital Rabat on Sunday.
Mr Ban has criticised Morocco for its angry response to his comments and said that the protests had shown disrespect to both him and the UN.
Morocco currently contributes more than 2,300 soldiers and police to UN peacekeeping missions, mainly in African countries such as Mali, Ivory Coast, the Central African Republic and Burundi.
A statement from the foreign ministry said it was "examining the ways and means of withdrawing Moroccan contingents engaged in peacekeeping operations".
Mr Ban made the comments while visiting refugee camps in southern Algeria, where more than 160,000 ethnic Sahrawis, the main indigenous group of Western Sahara, live after many fled violence there in the 1970s.
Morocco annexed most of the disputed former Spanish colony in 1976.
But the Polisario Front, backed by Algeria, has been seeking independence.
On Tuesday, there were reports that nearly 200,000 people joined a protest Laayoune, the main city in Western Sahara, to show support for Morocco in the row.
Morocco and the Polisario Front fought over Western Sahara until a ceasefire was signed in 1991.
Many of those who fled the conflict are still living in refugee camps in southern Algeria.