During the First Barbary War (1801-1805), the United States was allied with the Kingdom of Sicily against the Barbary corsairs due to a shared interest by both countries in putting an end to the disruption of trade on the Mediterranean Sea caused by the corsairs.
