The King James I entered the city of Valencia on 9 October 1238
The conquest of what would later become the Kingdom of Valencia started in 1232 when the king of the Crown of Aragon, James I, called Jaume I el Conqueridor (the Conqueror), took Morella, mostly with Aragonese troops. Shortly after, in 1233, Borriana and Peniscola were also taken from the بلنسية Balansiyya (Valencia in the Arabic language) taifa.
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.
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.
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.
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.
James II called Jaume II el Just or the Just, a grandson of James I, initiated in 1296 a final push of his army further southwards than the Biar-Busot pacts. His campaign aimed at the fertile countryside around Murcia and the Vega Baja del Segura whose local Muslim rulers were bound by pacts with Castile and governing by proxy on behalf of this kingdom; Castilian troops often raided the area to assert a sovereignty which, in any case, was not stable but was characterized by the typical skirmishes and ever changing alliances of a frontier territory.
The campaign under James II was successful to the point of extending the limits of the Kingdom of Valencia well south of the previously agreed border with Castile. His troops took Orihuela and Murcia. What was to become the definite dividing line between Castile and the Crown of Aragon was finally agreed by virtue of the Sentencia Arbitral de Torrellas (1304), amended by the Treaty of Elche (1305), which assigned Orihuela (also Alicante and Elche) to the Kingdom of Valencia, while Murcia went to the Crown of Castile, so drawing the final Southern border of the Kingdom of Valencia.
At the end of the process, four taifas had been wiped out: Balansiya, Alpuente, Denia and Murcia. Taking into account the standards of the day, it can be considered as a rather rapid conquest, since most of the territory was gained in less than fifty years and the maximum expansion was completed in less than one century. The toll in terms of social and politic unrest which was to be paid for this fast process was the existence of a large Muslim population within the Kingdom which neither desired to become a part of it nor, as long as they remained Muslim, was given the chance to.