Does the sentence "It was occupied by piratical kingdoms of the Barbary Coast, de facto independent since the 18th century." answer the question "Where were the piratical kingdoms from?"
yes