Summary of answer:
The majority of scholars are of the view – and it was narrated that there was consensus – that it is stipulated that the caliph of the Muslims should be a Qurashi (i.e., from Quraysh), because of the report narrated by Ahmad (12307) from Anas ibn Maalik, according to which the Messenger of Allah (blessings and peace of Allah be upon him) said: “The imams (rulers) are to be from Quraysh.”
This is a mutwaatir, saheeh hadith, as al-Haafiz Ibn Hajar (may Allah have mercy on him) said, as is stated in Sharh Nakhbat al-Fikr by al-Qaari (p. 190)
It says in al-Mawsoo‘ah al-Fiqhiyyah (6/219):
According to the majority of fuqaha’ it is stipulated that the ruler should be a Qurashi, because of the hadith, “The imams (rulers) are to be from Quraysh.” Some scholars disagreed with that, such as Abu Bakr al-Baaqillaani, and they quoted as evidence the words of ‘Umar: If Saalim the freed slave of Abu Hudhayfah was alive, I would have appointed him as my successor. End quote.
The caliphate belongs to Quraysh and it is not permissible for anyone to compete with them for it, so long as they uphold the faith.
Al-Bukhaari (3500) narrated that Mu‘aawiyah ibn Abi Sufyaan (may Allah be pleased with him) said: I heard the Messenger of Allah (blessings and peace of Allah be upon him) say: “Verily this matter belongs to Quraysh and no one opposes them but Allah will throw him onto his face (in the Fire), so long as they uphold the faith.”
What is meant is that they must obey them and not dispute with them, so long as they uphold the laws of Allah, may He be glorified and exalted.
Ahmad (4380) narrated from ‘Abdullah ibn Mas‘ood that the Prophet (blessings and peace of Allah be upon him) said: “O Quraysh, you are in charge of this matter, so long as you do not disobey Allah; but if you disobey Allah, He will send against you people who will strip you (of your authority) like this twig” – referring to a twig he had in his hand, which he stripped of its bark and cast aside, and it was shining white.
Classed as saheeh by al-Albaani in as-Saheehah (1552), who then said:
This hadith is one of the signs of his Prophethood (blessings and peace of Allah be upon him) because the caliphate remained with Quraysh for several centuries, then their state came to an end, because they disobeyed their Lord and followed their whims and desires. So Allah gave the non-Arabs power over them, and they seized power from them. End quote.
If a Qurashi caliph does not uphold the faith and is not able to rule the people, and the caliphate grows weak, and is taken over by one who is able to uphold the faith, unite the Muslims and raise the banner of jihad, then his rulership is valid and sound.
Ibn Qudaamah said:
If a man rebels against the ruler and defeats him, and prevails over the people by the sword until they submit to him and obey him, and they swear allegiance to him, then he becomes a ruler and it is forbidden to fight him and rebel against him. ‘Abd al-Malik ibn Marwaan rebelled against Ibn az-Zubayr and killed him, and he took control of the land and its people, until they swore allegiance to him either willingly or unwillingly. Thus he became a ruler and it became prohibited to rebel against him. That is because rebelling against him would cause division among the Muslims, and lead to the shedding of their blood and the loss of their wealth. The one who rebels against the ruler is included in the general meaning of the words of the Prophet (blessings and peace of Allah be upon him): “Whoever rebels against my ummah, when they are united, strike his neck with the sword, no matter who he is.”
End quote from al-Mughni (8/526)
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
Ability to rule people either stems from their obedience to the leader or from his compelling them. When he becomes able to rule them, whether by means of their obedience or his compulsion, then he has authority and is to be obeyed, if he enjoins people to obey Allah.
Hence Ahmad said in a letter to ‘Abdoos ibn Maalik al-‘Attaar: The basic principle of Ahl as-Sunnah, in our view, is to adhere to the way of the Companions of the Messenger of Allah (blessings and peace of Allah be upon him)… Whoever takes on the position of caliph, if the people are united behind him and are pleased with him, and whoever prevails by the sword until he becomes a caliph and is called ameer al-mu’mineen, then giving zakaah to him is permissible, whether he is righteous or an evildoer.
And he said – according to the report of Ishaaq ibn Mansoor – when he was asked about the meaning of the hadith of the Prophet (blessings and peace of Allah be upon him), “Whoever dies and does not have an imam (ruler) has died a death of Jaahiliyyah”:
Do you know what the imam (ruler) is? The imam is the one on whom all the Muslims agree, and all of them say: This is an imam (ruler). This is what it means.
End quote from Minhaaj as-Sunnah an-Nabawiyyah (1/528-529)
Ibn Battaal (may Allah have mercy on him) said:
The fuqaha’ are unanimously agreed that obedience to the imam who seized power by force is obligatory so long as he establishes Jumu‘ah and Eid prayers, wages jihad and in most cases treats those who have been wronged fairly, because obeying him is better than rebelling against him, so as to calm the masses and and avoid bloodshed.
End quote from Sharh Saheeh al-Bukhaari (2/328)
It says in al-Mawsoo‘ah al-Fiqhiyyah (8/37):
If someone seizes the position of imam (ruler) or any other position of authority by force, then he is a valid imam, and he must be obeyed with regard to what it is permissible to obey of his commands, prohibitions and decree, according to the consensus of the fuqaha’, even if he is one of those who follow innovations and whims and desires, so long as his innovation does not constitute kufr. That is so as to ward off a means that may lead to fitnah (and internal strife), so as to protect and preserve Muslim unity. End quote.
It was narrated that ‘Ubaadah ibn as-Saamit (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) called us to swear allegiance to him, and among the pledges that he took from us, we swore allegiance, promising to hear and obey whether we liked it or not, whether it was difficult for us or easy, even if others were favoured over us, and (we promised) not to dispute with people in authority, and he said: “Unless you see blatant kufr on his part for which you have proof from Allah.”
Narrated by al-Bukhaari (7056) and Muslim (1709)
Whoever seizes power by force and becomes a ruler, it is obligatory to obey him, so long as the people do not see blatant kufr on his part .
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked:
How can we reconcile between the words of the Messenger (blessings and peace of Allah be upon him), “You must hear and obey, even if an Abyssinian slave is appointed as ruler over you,” and his words, “The rulers are to be from Quraysh”? Is it possible or permissible for an Abyssinian slave to attain the highest position of authority (caliph)?
Yes, if Allah enables an Abyssinian slave to attain the highest position of authority (caliph), then he may attain that position. The Messenger (blessings and peace of Allah be upon him) only said that with regard to situations where we have the choice. If we want to choose a ruler for the Muslims, then we should choose someone from Quraysh, but who from Quraysh?
We should choose those who uphold the faith. As for merely belonging to Quraysh, or being from the family of the Messenger (blessings and peace of Allah be upon him), that is not a virtue in and of itself, unless it is accompanied by religious commitment. If a man from Quraysh comes to us and says that he is more deserving of being the ruler than anyone else, but he is an evildoer, we would say: No, because one of the conditions of being the ruler, when appointing a ruler, is that he should be of good character. But if someone subdues the people and becomes the ruler (by force), then it is obligatory to listen and obey him, even if he is an Abyssinian slave with a head like a raisin. There is a difference between the case when people have the choice and the case when someone seizes power and takes control of people by force. In the latter case we say that we should hear and obey, and not rebel, unless we see blatant kufr for which we have proof from Allah.
End quote from Liqa’ al-Baab al-Maftooh (185/19)
When the ‘Abbasid caliphate grew weak at the time of al-Mustamsik Billah and his son al-Mutawakkil, and the Ottoman sultan was strong, he seized the caliphate after the death of al-Mutawakkil, the ‘Abbasid caliph (may Allah have mercy on him).
Al-‘Isaami (may Allah have mercy on him) said:
Al-Mustamsik Billah remained as caliph until he grew old and lost his sight, and the Ottoman state was strong; they took over Egypt and Sultan Saleem took him (al- Mustamsik Billah) with him to Istanbul, where he remained until Sultan Saleem died. Then he returned to Egypt and was deposed, and his son al-Mutawakkil ‘Ali ibn al-Mustamsik Billah was appointed caliph in Sha‘baan 914 AH, and remained caliph until he died on 12 Sha‘baan 995 AH. With his death the nominal caliphate in Egypt also ended.
End quote from Samt al-Nujoom al-‘Awaali (3/533)
So the rule of Sultan Saleem became a valid rule by means of force. He was a powerful ruler and a courageous leader. His main ambition was to unite the Muslim regions, especially after the fall of Andalusia, and because of the weakness of the Abbasids and the danger posed by the Crusaders to the Muslim world.
If the Qurashi caliphate grows weak, and one who is stronger and more powerful seizes the position of caliph and rules in accordance with the Book of Allah, and he is more beneficial to the Muslims, his rule is legitimate and valid, and it is obligatory to hear and obey in his case.