Through subsequent battles, Tripoli eventually agreed to terms of peace with the United States. Tobias Lear negotiated a second "Treaty of Peace and Amity" with the Pasha Yusuf on June 4, 1805. To the dismay of many Americans, the new settlement included a ransom of $60,000 (equal to $ today) paid for the release of prisoners from the USS "Philadelphia" and several U.S. merchant ships. By 1807, Algiers had gone back to taking U.S. ships and seamen hostage. Distracted by the preludes to the War of 1812 and the war itself, the United States was unable to respond to the provocations until 1815, with the Second Barbary War, thereby concluding the First and the Second Barbary Wars (1800–1815).