Morocco recognized the United States on December 20, 1777.
This made Morocco the first country to acknowledge U.S. independence, just months after the Declaration of Independence, by opening its ports to American ships under Sultan Mohammed III.
The formal Treaty of Peace and Friendship, signed in 1786, remains the longest unbroken U.S. treaty.