This recognition was granted in 1777, making Morocco the first country to recognize the United States of America. Negotiations on a formal treaty to establish ties between the two countries began in 1783. The Moroccan-American Treaty of Friendship was signed in 1786.