Interestingly enough the Barbary states were like that historically. Most of the major European factions could have wiped them out if they had wanted to, but the other major nations always interfered. Various factions liked the fact that they could count on the Barbary states to raid their enemy's ships, while they themselves paid tribute for protection.
At various times Britain, France, Spain, Portugal and even America fought the Barbray pirates, but they always came back. Until Fance invaded them they were a pretty huge thorn in the side of everyone. Apparently people in Italy stopped living on the coast because of the slave raids they made. They even raided as four North as Ireland and Iceland.
Bookmarks