The invading forces were mostly Berber tribesmen from the Maghreb (the northwest of Africa), under Arab leadership. They and the other Muslim soldiers fighting with them were united by their religion. After the battle of Guadalete the city passed into the hands of the Arabs, and the bishopric was suppressed. Málaga then became for a time a possession of the Caliphate of Cordova. After the fall of the Umayyad dynasty, it became the capital of a distinct kingdom (taifa), dependent on Granada. The Muladi, or "Muwallads", were in almost constant revolt against the Arab and Berber immigrants who had carved out large estates for themselves, which were farmed by Christian serfs or slaves. The most famous of these revolts was led by a rebel named Umar ibn Hafsun in the region of Málaga and the Ronda mountains. Ibn Hafsun ruled over several mountain valleys for nearly forty years, having the castle Bobastro (Arabic : بُبَشْتَر) as his residence. He rallied disaffected muwallads and mozárabs to his cause, and eventually renounced Islam in 889 with his sons and became a Christian. He took the name Samuel and proclaimed himself not only the leader of the Christian nationalist movement, but also the champion at the same time of a regular crusade against Islam. However, his conversion soon cost him the support of most of his Muwallad supporters who had no intention of ever becoming Christians, and led to the gradual erosion of his power. When Hafs, son of Umar ibn Hafsun, finally laid down his arms in 928 and surrendered the town of Bobastro, Abd-al-Rahman III imposed the Islamic system of civil organisation in Mālaqa province. This allowed a new population distribution that encouraged urban development and the proliferation of farms in rural areas, as opposed to the pattern of feudalism dominant in the rest of Europe. The farmers practiced intensive irrigation-based agriculture, while artisanry and trade flourished in the cities—leading to prosperity and an era of peace in the province. Surrounded by a walled enclosure with five large gates, Mālaqa city itself thrived; the Alcazaba, a Moorish citadel, was built in the mid-11th century on Mount Gibralfaro, a hill in the center of the city overlooking the port. The fortress comprised two walled enclosures situated to conform to the steep terrain.