Barbary pirates took Europeans for ransom or slavery from passing ships or coastal towns as far north as Iceland. The first Barbary war attempted to stop the practice but this stoppage proved temporary but the second Barbary war finally stopped it. The US Marines hymn commemorates their involvement in the first Barbary war.