But, on December 20, 1777, Sultan Mohammed III of Morocco issued a declaration recognizing America as an independent country, and that American merchant ships could enjoy safe passage into the Mediterranean and along the coast.