The Moors were kicked out of this region in 972, after almost a century of occupation. Nonetheless, this part of the old Roman Province remained generally depopulated because the Saracens continued to pirate and raid for the next half-millennium, and, not coincidentally, because Provence was passed along during that time from the German Holy Roman Empire to the Spanish Kingdom of Aragon, and finally to the French kings.
But under René, Count of Provence, a deal was struck in 1470 with a citizen of the Republic of Genoa: in exchange for defending the coast and building a fortress in St. Tropez, the Genoese would pay no taxes and largely self-rule. And so sixty Genoese families migrated to St. Tropez and since then the city had its own navy and army which over the following century fought off pirates, Turks, and Spaniards at various times. The city's privileges, eroded from time by the kings of France, were finally terminated under Louis XIV, in 1672.
To this day, many family names in the St Tropez cemetery, if not most, are clearly Italian.