When Jefferson took the office he inherited troubled relationships with the Barbary States. The Barbary States were the Ottoman Regiences of the Algiers, Tunis, and Tripoli, along with independent Morocco. The U.S. had treaties with all four of these states. And tension began to rise. The reason being was that the Barbary states harbored and supported the actions of pirates against American shipping vessels in the Mediterranean Sea. This war ended up lasting for 5 years. Yet, it did not completely end the acts of piracy against American vessels, but it did prove that the United States was capable of waging war, if necessary, in places far from its own shores.