The United States Navy has been involved in anti-piracy activity in foreign territory throughout its history, from the Barbary Wars to combating modern piracy off the coast of Somalia and other regions.