Despite its small size Cabrera has a rich history. There are remains from the prehistoric period and we know about its Phoenician and Roman past thanks to the shipwrecks in its waters. In late antiquity it went through a period of splendour thanks to the monastic community that was established here and that produced indigo and garum. From the 8th century instability shook the Mediterranean. Owing to its strategic location Cabrera was coveted. It was used as a base for the Pisan-Aragonese attack that destroyed Mayurqa in the 12th century, and it bore continuous attacks from Barbary pirates, privateers and corsairs until the situation calmed down at the end of the 17th century and it came under the protection of a military garrison. During the Peninsular War (1809) one of the most terrible and least known incidents in Spain’s history took place; after the battle of Bailén over 9,000 French prisoners were sent to Cabrera and left to their fate. There were cases of cannibalism in order to survive, and barely a quarter of the men would leave the island. In the 20th century the island was used for farming, including livestock, the nearby islets being used as natural enclosures for breeding sheep and goats. This led to its degradation until the activity came to a stop and it was declared a protected space.