The origin of the practice has pre-Islamic roots, among the choice of successor in the
Arab tribes. In the Islamic period, this ancient practice was given new legitimacy when the first caliph,
Abu Bakr, nominated his successor, Caliph
Umar. Umar in turn later nominated a group of prominent Muslims to choose one of their number as his successor. The choice of heir was set on a hereditary basis by the first Umayyad caliph,
Mu'awiya I, who chose his own son,
Yazid I. The hereditary principle prevailed thereafter, although sometimes a brother could be chosen instead, or multiple sons be nominated as first and second heir; though usually the latter practice led to succession disputes. In
Sunni jurisprudence, the choice of successor and the act of designation is the absolute prerogative of the caliph or ruler; the oath of allegiance offered to the new heir confirmed his status, but was not a prerequisite for his legitimacy. This designation was made manifest through a testament (). In the Umayyad period, this was a relatively informal matter, and often the designation of an heir-apparent was made public only after the incumbent caliph's death. In the Abbasid period, this became a formalized and increasingly elaborate affair, deserving of a special ceremony, in which the new heir-designate also received the pledge of allegiance from the assembled court. After that, he received his own insignia and a
regnal name, by which he was named in the
Friday prayer, on banners and on coinage, alongside the caliph. If still underage, the heir-designate received a tutor, and he was later sent to govern a province in order to gain experience. In the early Abbasid period, heirs served as regents during the caliphs' absence from
Baghdad. ==Later usage==