The Treaty of Tripoli (Treaty of Peace and Friendship between the United States of America and the Bey and Subjects of Tripoli of Barbary) was signed in 1796. It was the first treaty between the United States and Tripoli (now Libya) to secure commercial shipping rights and protect American ships in the Mediterranean Sea from local Barbary pirates.