Question: Where were the piratical kingdoms from?
Sentence: It was occupied by piratical kingdoms of the Barbary Coast, de facto independent since the 18th century.
Answer in sentence: yes