Throughout the 16th century, the island suffered the incursions of pirates and Barbary privateers from North Africa - in 1543 and 1544 Hayreddin Barbarossa laid waste to the island, taking 4,000 prisoners in the process. In 1548 and 1552, Ischia was beset by his successor Dragut Rais. With the increasing rarity and diminishing severity of the piratical attacks later in the century and the construction of better defenses, the islanders began to venture out of the castle and it was then that the historic centre of the town of Ischia was begun. Even so, many inhabitants still ended up slaves to the pirates, the last known being taken in 1796. During the 1647 revolution of Masaniello, there was an attempted rebellion against the feudal landowners.