<P> A second and more relevant wave of expansion took place in 1238, when James I defeated the Moors from the Balansiya taifa . He entered the city of Valencia on 9 October 1238, which is regarded as the dawn of the Kingdom of Valencia . </P> <P> A third phase started in 1243 and ended in 1245, when it met the limits agreed between James I and the heir to the throne of Castile, Alfonso the Wise, who would succeed to the throne as Alfonso X in 1252 . These limits were traced in the Treaty of Almizra between the Crown of Castile and the Crown of Aragon, which coordinated their Reconquista efforts to drive the Moors southward by establishing their respectively desired areas of influence . The Treaty of Almizra established the south line of Aragonese expansion in the line formed by the villes of Biar and Busot, today in the north of the Alicante province . Everything south of that line, including what would be the Kingdom of Murcia, was reserved by means of this treaty for Castile . </P> <P> The matter of the large majority of Mudéjar population, left behind from the progressively more southern combat front, lingered from the very beginning until they finally were expelled en masse in 1609 . Up to that moment, they represented a complicated issue for the newly established Kingdom, as they were essential to keep the economy working due to their numbers, which inspired frequent pacts with local Muslim populations, such as Mohammad Abu Abdallah Ben Hudzail al Sahuir, allowing their culture various degrees of tolerance but, on the other side, they were deemed as a menace to the Kingdom due to their lack of allegiance and their real or perceived conspiracies to bring the Ottoman Empire to their rescue . </P> <P> There were indeed frequent rebellions from the Moor population against Christian rule, the most threatening being those headed by the Moor chieftain Mohammad Abu Abdallah Ben Hudzail al Sahuir, also known as Al - Azraq . He led important rebellions in 1244, 1248 and 1276 . During the first of these, he briefly regained Muslim independence for the lands South of the Júcar, but he had to surrender soon after . During the second revolt, king James I was almost killed in battle, but Al - Azraq also was finally subjugated, his life spared only because of a longtime relationship with the Christian monarch . During the third rebellion, Al - Azraq himself was killed but his son would continue to promote Muslim unrest and local rebellions remained always at sight . </P>

Who captured the city of valencia during the christian reconquest of spain