Marwan ibn al-Hakam designated his son Abdul-Malik as the next Khaleefah (wali al-ahd) after his death. Marwan also designated his other son Abdul-Aziz, the father of Umar ibn Abdul-Aziz as the next Khaleefah after Abdul-Malik. Abdul-Aziz was the governor of Egypt under Abdul-Malik, but passed away before Abdul-Malik died. This meant Abdul-Malik could change the designated successors to his two sons Al-Walid and Sulayman, according to the opinion they had adopted on the bay’a at the time.
While the Ahlul hali wal-aqd of ash-Sham did give bay’a to Abdul-Malik in 66H/685CE, this bay’a was initially invalid (batil) because Abdullah ibn az-Zubayr was the legitimate Khaleefah. It is not permitted for the bay’a to be given to two Khaleefahs at the same time. This is well-established from the sunnah where the Messenger of Allah ﷺ said, “If a bay’a is taken for two Khaleefahs, kill the latter among them.”
The sahaba acted upon this sunnah and when they gathered in the courtyard (saqifa) of Banu Sa’ida to elect the first Khaleefah, one of the Ansar said, “Let there be an Ameer from among us and an Ameer from among you.” Abu Bakr responded, “And it is not permitted for the Muslims to have two Ameers. If that would occur it would lead to a differing in their affairs and rulings, and their community (jamaa’ah) would be divided, and there would be dispute between them. That would be discarding the sunnah, bidah would arise and fitna would spread. None of that would be goodness for anyone.”
Mawardi mentions, “If two Imamates are established in two countries none of the two is valid as it is not permitted for there to be two imams at one time.”
Suyuti summaries the bay’a to Abdul-Malik. “He received the bay’a according to his father’s contract during the Khilafah of Ibn az-Zubayr, but his Khilafah was not valid and he remained as the usurper (mutaghallib) of Egypt and Syria. He then seized Iraq and its provinces before Ibn az-Zubayr was killed in 73H/692CE. From that day, his Khilafah became valid and his authority firmly established.”
Taqiudeen an-Nabhani explains the situation when a Usurper المتسلط (Al-Mutasalit) or Dominant Sultan السلطان المتغلب (As-Sultan Al-Mutaghalib) takes the bay’a by force. “If a usurper were to seize power by force he would not become Khaleefah, even if he declared himself to be the Khaleefah of the Muslims. This is because the Muslims in this case would not have contracted the Khilafah to him. If he were to take the bay’a from the people by force and coercion he would not become Khaleefah even if the bay’a was given to him. This is because a bay’a that is taken by force and coercion is not considered valid and the Khilafah cannot be concluded by it. For it is a contract based on mutual consent and choice and cannot be concluded forcefully or by coercion. The Khilafah cannot therefore be concluded except by a bay’a of consent and choice.
However, if the usurper managed to convince the people that it would be in the interest of the Muslims to give him their bay’a and that the implementation of the Shar’a rules obliges them to give the bay’a, and they were convinced of that and accepted it and then gave him the bay’a by consent and free choice, he would become Khaleefah from the moment that the bay’a was given to him by consent and choice. This is the case, even though in the first place he seized the authority by coercion and force. The condition is giving the bay’a and that it must be by mutual consent and free choice, regardless of whether the one who was given the bay’a was the ruler or not.”
Ibn Hajar says, “The jurists have unanimously agreed that it is obligatory to obey the dominant sultan and jihad with him, and that obedience to him is better than revolting against him because that (will lead to) shedding blood and pacifying the masses.”
The legitimacy of the bay’a to the dominant sultan is not a license for usurping power. There are conditions which he must fulfil. Ata Abu Rashta mentions:
“As for the matter of the Dominant Sultan which was mentioned in some jurisprudence books, its meaning needs to be understood, not just repeat the terms “dominant Sultan”, without understanding when and how it is to be Islamically erected and when and how it is not Islamically erected; otherwise it will have dire consequences on its people!
The dominant Sultan would be sinful for Muslim bloodshed and dominating them through subjugation, force and coercion, and a legitimate Khilafah would not rise through him for violating the Islamic legislative method… However, some scholars see that this dominant Sultan’s ruling becomes Islamically valid if he fulfilled conditions, most notably:
a) He becomes dominant in a land that has the components of a State as per the region surrounding it, so he has a stable authority in it and has control over the internal and external security of the land towards the region surrounding him.
b) Implements Islam with justice and benevolence in that land, and sets a good repute for himself between the people, thus liking them and them liking him and being satisfied with him.
c) The people of that land give him the bay’a of contract with satisfaction and choice, not with coercion and force, and fulfilling the conditions of the legitimate bay’a including that the bay’a in origin should be from the people of that land, and not from the group of the dominant Sultan, because the legitimate Bayah is like that following the example of the Messenger of Allah ﷺ, the Prophet ﷺ was keen to take the initial bay’a from the Ansar of the Madinah with satisfaction and choice, not take it from his Sahabah the Muhajirun, and the second pledge of allegiance proves this.
Thus, the dominant Sultan continues to be in sin, and no legitimate base is erected except after he fulfills the above three conditions, then the ruling of the dominant Sultan becomes legitimate from the moment of that bay’a with satisfaction and choice. This is the reality of the dominant Sultan, hoping that attentive ears may retain it… and it becomes clear from it that these conditions were not fulfilled for the owners of that announcement, they however imposed themselves and their announcement was done unjustly.”
This then explains the difference between the bay’a to Yazid ibn Mu’awiya and Abdul-Malik ibn Marwan who were both usurpers. The bay’a to Yazid was never legally convened because the Ahlul hali wal-aqd never gave bay’a through free choice and consent. Whereas with Abdul-Malik the Ahlul hali wal-aqd in Hijaz and Iraq, finally agreed to give bay’a once Abdullah ibn az-Zubayr had been killed by Abdul-Malik’s infamous commander, Hajjaj bin Yusuf. Among those who gave bay’a to Abdul-Malik after ibn az-Zubayr’s death were Abdullah ibn Umar and his family in Madinah.
Bukhari narrates from Abdullah bin Dinar: “I witnessed Ibn Umar when the people gathered around Abdul Malik. Ibn Umar wrote: ‘I gave the bay’a that I will listen to and obey Allah’s Slave, Abdul-Malik, Ameer of the believers according to Allah’s Laws and the Traditions of His Messenger as much as I can; and my sons too, give the same pledge.’”
 Sahih Muslim 1853, https://sunnah.com/muslim:1853
 Sahih al-Bukhari 3667, https://sunnah.com/bukhari:3667
 Baihaqi from Ibn Ishaq, https://al-maktaba.org/book/6947/987
 Abu l-Hasan al-Mawardi, The Laws of Islamic Governance, translation of Al-Ahkam as-Sultaniyah, Ta Ha Publishers, pp.16
 Jalal ad-Din as-Suyuti, ‘History of the Umayyad Khaleefahs,’ translated by T.S.Andersson, Ta Ha Publishers, pp.45
 Taqiuddin an-Nabhani, ‘The Ruling System in Islam,’ translation of Nizam ul-Hukm fil Islam, Khilafah Publications, Fifth Edition, pp.62
 Ibn Hajar, Fath Al-Bari (13/7)
 Ata Abu Rashta, ‘Q&A: The Legislative (Shari’) Method of Establishing the Khilafah and the Dominant Sultan,’ Khilafah.com
 Sahih al-Bukhari 7203, https://sunnah.com/bukhari:7203