Timeline
1801 :
Jefferson became president
Tripoli declares war on the United States
1802 :
Congress passed the Act for Protection of Commerce and Seamen of the United States
The Emperor of Morocco declares war
1804 :
Commodore Preble launches an attack on Tripoli that lasts until September 11
1805 :
Treaty of Tripoli was officially signed
1809 :
James Madison becomes president
1815 :
Congress declared war on Algiers