Key events

First Barbary War:

The first conflict/war was in 1801 when Jefferson became president. The Barbary Sate of Tripoli pirated and captured our merchants and their goods, In retaliation of that, Jefferson decided to sent a ship into the Mediterranean to go attack the Barbary state of Tripoli. In result, the United States lost this battle, losing the USS Philadelphia, but got the hostages in return. A treaty was also formed between the pirates and the United States stating there would be no subtle attacks on either side against the other and to stay out of each other's way.

Second Barbary War:

Started in 1815, at the time when James Madison was president. Early 1815 Madison expressed to Congress that he wanted to declare war on the Barbary Coast/states. He says in his speech to Congress " I recommend to Congress the expediency of an act declaring the existence of a state of war between the US, and the Dey of Algier". He declared war for protection of the United State ships after seeing how the USS Philadelphia diminished, and also to assert his dominance as president of the United States at the time. This war resulted in a win for the United States.