<em>The First Barbary War (1801–1805)</em>,was faught between United States of America and Barbary states during which <em>Thomas jefferson</em> served as the <em>president</em> of the United states.
Explaination:
The First Barbary War (1801–1805), also called as the<em> Tripolitanian War</em> and the Barbary Coast War, in which the United States and Sweden battled against the four North African states referred as the "Barbary States". These were the <em>Sultanate of Morocco, Tripoli, Algiers, and Tunis.</em>
The reason for the U.S. cooperation was the pirates from these States who<em> captured American ships and takes the crews as hostages for money.</em> Demanding the United States to pay money to the Barbary rulers, which was refused by the U.S President Thomas Jefferson.