1801–1805
First Barbary War
A conflict over commerce, captives, and tribute, though Tripoli's envoy had framed the demands in religious terms in 1786.
Morocco briefly declared war in 1802, then reaffirmed its 1786 treaty after a U.S. naval show of force at Tangier in 1803.
Source
U.S. Department of State, Office of the Historian: Barbary Wars, 1801–1805 and 1815–1816