In 1777, Morocco’s Sultan Sidi Muhammad ibn Abdallah opened his ports to American ships, an act often described as first recognition of newly independent United States by another country. Formal recognition followed in 1786 through Treaty of Peace and Friendship between Morocco and United States.