December 1777: Morocco became the first country to recognize the United States.
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.
The 1786 Treaty of Peace and Friendship was America's first with an Arab, African, or Muslim nation, and the only one of its generation still in force: reaffirmed in 1836, it survived every American war and every Moroccan upheaval. The State Department still calls it the longest unbroken relationship in United States diplomatic history.
In 1821 the Sultan gave the United States a building in Tangier's medina for its diplomats — America's first diplomatic property abroad, and today the only U.S. National Historic Landmark on foreign soil. It now houses the Tangier American Legation Institute for Moroccan Studies: a museum of two and a half centuries of friendship.
The symmetry came full circle in 1956, when the United States was among the first to recognize Morocco's restored independence. The partnership has deepened ever since — Morocco is a major non-NATO ally and America's free-trade partner in Africa — but its foundation stone was laid in 1777, when a sultan in Marrakech believed in a republic that did not yet exist.