In the first years of the 19th century, the United States, allied with European nations, fought and won the First and the Second Barbary Wars against the pirates. The wars were a direct response of the American, British, French and the Dutch states to the raids and the slave trade by the Barbary pirates against them, which ended in the 1830s when the region was conquered by France. The Barbary slave trade and slave markets in the Mediterranean declined and eventually disappeared after the European occupations.