Because it is often the result of failure or laxity in patrolling sea routes, piracy flourished in times of unrest, or when navies ordinarily protecting commerce were engaged in war. Pirates found their most suitable base of operations in an archipelago that offered shelter together with proximity to trade routes. Pirates preyed upon Phoenician and Greek commerce and were so active in the 1st cent. B.C. that Rome itself was almost starved by their interception of the grain convoys.
Pompey swept piracy from the Mediterranean, but with the decline of the Roman empire it revived there and was prevalent until modern times. Muslim pirates infested the W Mediterranean; the Venetians, who ostensibly policed the E Mediterranean, preyed upon the maritime trade of rival cities; and the Barbary States got much of their revenue from piracy. In the North, the Vikings harassed the commerce of the Baltic Sea and the English Channel. Emerging in the 13th cent., the Hanseatic League succeeded in curbing the piracy of its era.
New trade routes opened during the Renaissance, e.g., the shipment of precious metals from the Spanish colonies, the rich trade with the East, and the development of the slave trade, that made piracy especially lucrative. At this period no great stigma was attached to piracy because maritime law had not been systematized. This fact, together with the increasing colonial rivalry of the powers, led states to countenance those pirates who promoted the national cause by attacking the commerce of rival nations. With the tacit approval of the provincial authorities, the West Indies became a pirates' rendezvous, and the English buccaneers of the Spanish Main in the 17th and 18th cent., who despoiled the Spanish treasure armadas and pillaged Spanish-American coast settlements, returned to England to divide their spoils with the crown and to receive the royal pardon.
The development of national navies caused the decline of piracy. Beginning in 1803, the United States endeavored to crush the corsairs of Tripoli. In 1815 and 1816 the United States, the Netherlands, and Great Britain wiped out the Barbary pirates, who had exacted tribute under the threat of capturing ships and imprisoning their crews. In 1816, Great Britain and the United States began operations against pirates in the West Indies, particularly those on the Cuban coast, and in 1824 the United States sent David Porter to complete the task. The power of the pirates along the Straits of Malacca and the China seas was broken after the Opium Wars in the late 19th cent. During the Spanish Civil War the major powers agreed (1937) at the Nyon Conference on an antipiracy pact after mysterious attacks on merchant ships in the Mediterranean. Small-scale piracy has persisted in some waters, particularly in Indonesia and SE and S Asia, in the Red Sea and off Somalia, in the Gulf of Guinea off W Africa, and off Ecuador. In the early 21st cent. the lawlessness in Somalia led to the rise there, initially mainly in the Gulf of Aden but subsequently over much of the NW Indian Ocean, of more significant organized piracy for ransom. Several nations stationed warships offshore to combat it and protect the Suez shipping lanes, and merchant ships traveling in the region began carrying armed guards, leading to a large drop in ship seizures by 2012.