The North African nation and the European Union signed in 2012 a multi-million-euro fishing and agriculture trade agreement.
Two years later the deal was quashed by a European court after a challenge from the Polisario Front which seeks independence for the disputed territory of Western Sahara.
But the EU's top court overturned that verdict in December 2016, setting the stage for the reinstatement of the agreement although the ruling did not say so explicitly.
Failure to do so would affect "thousands of jobs" both in Morocco and in Europe, said the ministry.
More From This Section
Furthermore it could spur "a new flow of migration" towards Europe and place the continent "at risk".
In addition, it would force Morocco to seek trade deals with other countries.
The ministry said if the deal with the EU was not implemented, Morocco "would have no other choice but to turn to other countries" including Russia, China, India and Japan as well as African and Arab Gulf nations.
Although most migrants from sub-Saharan African seeking a new life in Europe have been travelling through chaos-riddled Libya, others have managed in recent years to enter Spain from Morocco.
Spain has two enclaves in North Africa - Ceuta and Melilla - surrounded by hi-tech border fences that are regularly stormed by migrants. Many have died tried to climb them, some shot by Moroccan forces.
Other migrants, most of them from sub-Saharan Africa, take to rickety boats to try to cross the narrow stretch of sea between Morocco and Spain's southern tip.