Moroccan–American Treaty of Friendship

The Moroccan–American Treaty of Peace and Friendship, also known as the Treaty of Marrakesh, was a bilateral agreement signed in 1786 that established diplomatic and commercial relations between the United States and Morocco. It was the first treaty between the U.S. and an Arab, African, and Muslim nation, and initiated what remains the longest unbroken diplomatic relationship in U.S. history.

Nearly a decade before the treaty, on 20 December 1777, Moroccan Sultan Mohammed III, decreed that American ships could freely enter his kingdom's ports and enjoy safe passage through its waters; and became one of the first heads of state to publicly recognize U.S. independence during the American Revolutionary War.

Following several overtures by the Sultan, and with the urging of John Adams, John Jay, and Benjamin Franklin, in 1785 the U.S. Congress authorized negotiations for a treaty with Morocco. American diplomat Thomas Barclay was chosen to represent the U.S., and with the aid and backing of Spain, met his Moroccan counterpart, Tahir Fannish, in Marrakesh in June 1786. The treaty was finalized within days of Barclay's arrival, sealed by Mohammed III, and signed by Thomas Jefferson and John Adams at their respective diplomatic posts in Paris and London; Congress ratified the treaty on 18 July 1787, which was to last fifty years.

Background
Muhammad III, or Sidi Muhammad bin 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. Sidi Muhammad transformed politics, the economy and society by prioritizing development of international trade and restoring power to the sultanate, which improved Morocco's standing internationally. Central to his pursuit of international trade was the negotiation of agreements with foreign commercial powers. He began seeking one with the United States before the war with Great Britain had ended in 1783, and he welcomed Thomas Barclay's arrival to negotiate in 1786. The treaty signed by Barclay and the sultan and then by Jefferson and Adams was ratified by the Confederation Congress in 1787. It was reaffirmed by the sultan in 1803, when the USS Constitution, Nautilus, New York, and Adams engaged in gunboat diplomacy as part of the First Barbary War. At the time, independent corsairs and pirates were using Morocco's ports as safe harbors between raids on American and European shipping. , the treaty has withstood transatlantic stresses and strains for more than 235 years, which makes it the longest unbroken treaty relationship in United States history.