Caliphate of Cordoba conquered Majorca in 902, escorting a new period in the prosperity of the island. Many local industries were developed and agriculture was improved by the Moors with irrigation. In 1015, Majorca came under the ruling of the Taifa of Denia, and was an independent Taifa from 1087 – 1114. Though in 1114, the Pisans and Catalans laid their siege on Palma for 8 months. After the fall of the city, the invaders gave way and were replaced by the Almoravides from North Africa. In 1203, the Almohad dynasty ruled over the island replacing the Almoravides. In 1229 King James I of Aragon attacked with 15,000 men and 1,500 horses, taking the possession of Majorca after a three-month war.