Toledo wrote verses against the Umayyads, helping to inspire a revolt in Toledo against the new emir in 797. By the end of the 8th century, the Umayyads had made Toledo the administrative center of the Central March of Al-Andalus. In 852, a new revolt broke out in Toledo. The Umayyad governor was held hostage in order to secure the return of Toledan hostages held in Córdoba. In reprisal of a prior attack by Toledans, emir Muhammad I sent an army to attack the Toledans, but was defeated. Toledo forged an alliance with King Ordoño I of Asturias. They fought together at the Battle of Guadacelete but lost. Later in 857, the Toledans attacked Talavera but were again defeated. In 859, Muhammad I negotiated a truce with Toledo. The city became virtually independent for twenty years, though locked in conflict with neighboring cities. Cordobese authorities re-asserted control over Toledo in 873, after the successful Umayyad siege on the city, which forced defenders to submit. The Banu Qasi gained nominal control of the city until 920. Following a new period of unruliness in the 920 and 930s, Caliph Abd-ar-Rahman III captured the city in 932, following an extensive siege. In the wake of the early 11th-century Fitna of al-Andalus, Toledo became the centre of an independent polity, the so-called Taifa of Toledo, under the rule of the Dhu l-Nunids. The population of Toledo at this time was about 28,000, including a Jewish population of 4,000. The Mozarab community had its own Christian bishop. The taifa was centered on the Tajo River and bordered Sierra de Guadarrama, Guadalajara, Medinaceli, the Taifa of Valencia and the Mountains of Toledo. The taifa fell in political disarray, owing to the economic draining caused by the parias (tributes) imposed by the kingdom of León as well as territorial mutilations, and so a revolt erupted in 1079, which was followed by the Aftasid ruler of Badajoz taking control of the city. On 25 May 1085, Alfonso VI of León took Toledo and established direct personal control over the city from which he had been exacting tribute. Upon that time, the city's demographics featured a heterogeneous composition, with both Mozarabs, Muslims and Jewish communities, to which incoming Christians from northern Iberia and Frankish elements added up, so, initially, different fueros were simultaneously in force for each community. After the Christian conquest, the city's Mozarab community grew by immigration