The Tripolitan War took place from 1801 to 1805 between the United States and the Barbary States of North Africa, including Tripoli, over pirate attacks on American ships in the Mediterranean Sea. Congress had agreed to pay tribute to the Barbary States but the Jefferson administration stopped payments. This led to an informal declaration of war by the Barbary States against the United States. The US sent ships to blockade Tripoli's port and won a decisive victory on land at Derna, establishing the US as a threat and forcing Tripoli to make peace, though it lasted only a few years.