It emerged after 1018 upon the fracturing of the Caliphate of Córdoba, when the Dhulnunids, already strong in the lands of Santaver, Cuenca, Huete and Uclés, seized control over the city of Toledo, the capital of the Middle March of Al-Andalus.
These Toledans offered the city to the lord of Santaver (Santabariyya), Abd al-Rahman ibn Dil-Nun, who, around 1035, sent his son Ismail al-Zahir to Toledo to take control.
The Banu Dil-Nun (Thu al Nun) were a family of the Arabian tribe, that had arrived in the peninsula during the Islamic conquest.
The Cordoban lands were lost in 1077, as well as the southernmost provinces of the kingdom, and Al-Qadir also found himself attacked by Al-Mutawakkil of the taifa of Badajoz.
He was able to regain the throne the following year, the agreement including the acquisition of Toledo by the Castilian kingdom, while al-Qadir would keep ruling Valencia.
The latter responded by attacking his enemies and, after four years of "siege", Toledo officially and peacefully fell into Christian hands on 6 May 1085.