Answer :
The First Barbary War was an undeclared war waged by the United States against the North African states of Morocco, Tripoli, Algiers, and Tunis. The principle cause of the war was that those states harbored and supported the actions of pirates against American shipping vessels in the Mediterranean Sea.