It was occupied by piratical kingdoms of the Barbary Coast, de facto independent since the 18th century