 The 19th century saw the United States transition from an isolationist, post-colonial regional power to a Trans-Atlantic and Trans-Pacific power.The first and second Barbary Wars of the early 19th century were the first nominal foreign wars waged by the United States post-Independence.Directed against the Barbary States of North Africa, the Barbary Wars were fought to end piracy against American-flagged ships in the Mediterranean Sea, similar to the Quasi-War with post-monarchical France.