withdrawal due to Islamic expansion across the Mediterranean, to reinforce their domination upon the rest of the population, thus ensuring their power and the gradual abandonment of Imperial political structures. In 707, a Muslim fleet, under the command of Abd Allah ibn Musa, son of the governor of Ifriqiya, Musa ibn Nusayr, stopped off at the island. It appears that Abd Allah convinced the powers of the city to accept a peace treaty. This treaty was granted in exchange for a tax, respect for the social, economic, and political structures of the communities that subscribed to it, as well as the continuity of their religious beliefs. After 707, the city was inhabited by Christians who were nominally in allegiance to the sovereignty of the Umayyad Caliphate, yet who, de facto, enjoyed absolute autonomy. The city, being in Mallorca, constituted an enclave between western Christian and Islamic territories, and this attracted and encouraged increased levels of piracy in the surrounding waters. For wide sectors of the city's population, the sacking of ships (whether Muslim or Christian) which passed through Balearic waters was a source of riches over the next fifteen decades. Eventually, continued piracy in the region led to a retaliation by Al-Andalus which launched a naval fleet against the city and the whole of the Islands. The Islands were defended by the emperor Charlemagne in 799 from a Muslim pirate incursion. In 848 (maybe 849), four years after the first Viking incursions had sacked the whole island, an attack from Córdoba forced the authorities to ratify the treaty to which the city had submitted in 707. As the city still occupied an eccentric position regarding the commerce network established by the Moors in the western Mediterranean, the enclave was not immediately incorporated into Al-Andalus. While the Emirate of Córdoba reinforced its influence upon the Mediterranean, Al-Andalus increased its interest in the city. The consequence of this was the substitution of the submission treaty for the effective incorporation of the islands to the Islamic state. A squad under the command of Isam al-Jawlani took advantage of the instability caused by several Viking incursions and disembarked in Mallorca, and after destroying any resistance, incorporated Mallorca, with Palma as its capital, to the Córdoban state. The incorporation of the city into the Emirate set the basis for a new society. Commerce and manufacturing developed in a previously unknown manner. This caused considerable demographic