In December 1777, Sultan Mohammed III opened Morocco's ports to American ships — the first recognition the young United States received from any foreign sovereign. The Treaty of Peace and Friendship signed in 1786, and ratified the next year, remains in renewed form the longest unbroken treaty in American history.
The decree came while Washington's army shivered at Valley Forge: Morocco, alone among the world's powers, wagered on the American cause. Mohammed III — Sidi Mohammed ben Abdallah — was opening his ports to all nations' trade; including the rebellious colonies was a deliberate, visionary bet. Nine years later his envoy and Thomas Barclay concluded the treaty that Jefferson and Adams signed in Paris and Congress ratified in July 1787, two months before the Constitution.