Moroccan–American Treaty of Friendship
In December 1777, Moroccan sultan Muhammad III included the United States of America in a list of countries to which Morocco’s ports were open. Morocco thus became the first country whose head of state publicly recognized the new United States. Relations were formalized with the Moroccan–American Treaty of Friendship negotiated by Thomas Barclay, and signed by Thomas Jefferson, John Adams and Muhammad III in 1786.
Situation in Morocco
Muhammad III, or Sidi Muhammad ibn Abdallah, came to power in 1757 and ruled until his death in 1790. Prior to his reign, Morocco had experienced 30 years of internecine battles, instability and turmoil. During the 33 years Sidi Muhammad ruled he transformed the politics, the economy and the society, putting development of international trade high on his agenda and restoring power to the sultanate. This served to quickly bring respect to Morocco on the international scene. Central to his pursuit of international trade was the negotiation of agreements with foreign commercial powers. He actively began seeking one with the United States well before the war with Great Britain was settled in 1783, finally got America's attention in 1784, and warmly welcomed Thomas Barclay's arrival to negotiate in 1786. The treaty signed by Barclay and the sultan, then by Jefferson and Adams, was ratified by the Confederation Congress in July 1787. It has withstood transatlantic stresses and strains for more than 220 years, making it the longest unbroken treaty relationship in United States history.
- Roberts, Priscilla H. and Richard S. Roberts, Thomas Barclay (1728-1793): Consul in France, Diplomat in Barbary. Lehigh University Press. 2008, pp.158-223. ISBN 978-0-934223-98-0.
- US-Morocco: Longstanding Ties (Remarks by President Bush and King Hassan II); U.S. Department of State Dispatch,  (24 January 2007).
- B.A. Ogot, General History of Africa, Vol. V: Africa from the 16th to the 18th Century. Berkeley: University of California Press, 1992. pp. 231-232.
- Roberts, Thomas Barclay (1728-1793)..., pp.195-223
- Ogot, General History of Africa, pp. 231-232.