Between 1801 and 1805, the United States fought a war against North African corsairs. Piracy was an important part of Morocco, Algeria, Tunis and Tripoli’s history which was not really appreciated by the Americans.