Morocco and the United States have a long history of friendly relations. This North African nation was one of the first states to seek diplomatic relations with America. In 1777, Sultan Sidi Muhammad Ben Abdullah, the most progressive of the Barbary leaders who ruled Morocco from 1757 to 1790, announced his desire for friendship with the United States. The Sultan’s overture was part of a new policy he was implementing as a result of his recognition of the need to establish peaceful relations with the Christian powers and his desire to establish trade as a basic source of revenue. Faced with serious economic and political difficulties, he was searching for a new method of governing which required changes in his economy. Instead of relying on a standing professional army to collect taxes and enforce his authority, he wanted to establish state-controlled maritime trade as a new, more reliable, and regular source of income which would free him from dependency on the services of the standing army. The opening of his ports to America and other states was part of that new policy.
The Sultan issued a declaration on December 20, 1777, announcing that all vessels sailing under the American flag could freely enter Moroccan ports. The Sultan stated that orders had been given to his corsairs to let the ship “des Americains” and those of other European states with which Morocco had no treaties-Russia Malta, Sardinia, Prussia, Naples, Hungary, Leghorn, Genoa, and Germany-pass freely into Moroccan ports. There they could “take refreshments” and provisions and enjoy the same privileges as other nations that had treaties with Morocco. This action, under the diplomatic practice of Morocco at the end of the 18th century, put the United States on an equal footing with all other nations with which the Sultan had treaties. By issuing this declaration, Morocco became one of the first states to acknowledge publicly the independence of the American Republic.