first barbary war The first barbary war (1801–1805, also known as the barbary coast war or the tripolitan war) was one of two wars fought between the united states of america and the north african empire of morocco and city-states of algiers, tunis, and tripoli, known collectively as the barbary states.