America’s longest unbroken foreign relationship is with Morocco, which was technically the first country to recognize the U.S. as an independent nation.
Sultan Muhammad III—who had just consolidated his reign after years of instability and turmoil—wanted to establish fruitful trade relations; so, in 1777, just as the American Revolution was heating up, he declared Morocco’s ports open to American ships, promising them safe passage into the Mediterranean and protection from pirates—even from fellow Muslim nations. (Even France, which would become our biggest ally and the first country to sign a treaty with us, had not openly declared support at this stage.)
The provisions of the treaty are incredibly progressive and amicable, relative to our perception of Christian-Muslim relations at the time (let alone today). In addition to reaffirming protection of one another’s commercial vessels, it obligates the two nations to never to assist the other’s enemies, to allow safe travels to each other’s citizens within their territory, and even provides a procedure in the event their nationals dies in the other’s lands without a will.