Pirates were always known for pillaging and plundering ports across the Pacific, but who says that pirates cant form their own country.
In the early years of the 18th century, the island of Nassau in the Bahamas (which was British controlled) came under attack from the Spanish, the end result was that the island became pretty much deserted with no real government left to control the island. This set the scene for English privateers to make a base, soon they became the pirates of the Caribbean, attacking merchant ships of any nation as they passed on by.
The pirates, now having control of the island, established their own democratic republic with elected officials, and a governing code for all to live by. Word soon spread throughout the world and other privateers came to join the republic, with as many as 1,000 pirates occupying the island at its peak.
Nassau saw many famous pirates join the republic, such as Henry Jennings, Benjamin Hornigold, Calico Jack, Edward Teach, Mary Read, Charles Vane, and others. Edward Teach (otherwise known as Blackbeard) was elected magistrate at one point, to govern the law and order of the republic.
The republic led to the creation of the 'Flying Gang', which was a group of the most notorious pirates who attacked ships in unison. The pirates were known for attacking mostly Spanish and French flagged ships and avoided attacking the British at all costs (due to the power of the British Royal Navy), but eventually the British came under fire as well.
By 1718, British King George I had had enough of the pirate republic and appointed a new governor to put down the pirates. When the new Governor (Woodes Rogers) arrived (along with 7 seven British Naval Warships), he came with an offer of pardon for any pirate who gave up their pirating ways.
Most pirates had escaped the island by that time (or accepted the pardon), however the new Governor was able to convince notorious pirate Benjamin Hornigold to switch sides and become a pirate hunter, tracking down his former pirate allies.
Hornigold managed to capture 10 pirates by the end of the year (most of them were executed), but Blackbeard and Vane managed to evade Hornigold and escape from the island. Blackbeard continued his pirate ways until he was killed by British forces off the coast of North Carolina in November 1718.
With the pirate republic at its end, the British reasserted its control of the Bahamas.