Short answer
Ali's own words and deeds answer this. When the community chose Abu Bakr, Ali felt the Prophet's (ﷺ) family should have been consulted. But he gave Abu Bakr his pledge and praised him in public. He then stood by Abu Bakr, Umar and Uthman. When his own son asked who were the best people after the Prophet (ﷺ), Ali said: Abu Bakr, then Umar. At Umar's funeral, he said he had always hoped God (﷾) would place Umar beside his two companions. He said that in Uthman's place he would have done the same with the copies of the Qur'an. When Ali was later asked to become caliph, he refused at first, and accepted only when pressed. No one can know what might have been. But Ali himself did not treat the first three caliphs as wrongdoers. Muslims honour all four. The Prophet (ﷺ) also foretold that the caliphate of prophecy would last thirty years, then become kingship. It came true: thirty years by the Islamic calendar, then rule passed down within one family.
Full explanation
The community chose, and Ali pledged
After the Prophet (ﷺ) died, the Companions chose Abu Bakr. Ali held back his pledge for some months. He told Abu Bakr that the family knew his excellence and did not envy it. But they felt they should have been consulted, because of their kinship to the Prophet (ﷺ). Abu Bakr wept and said the Prophet's (ﷺ) relatives were dearer to him than his own. Ali gave his pledge that afternoon and praised Abu Bakr's right in public (Bukhari 4240).
In a long report from Aisha, Ali, who had not given his pledge during the six months of Fatima's life after the Prophet's (ﷺ) death, seeks reconciliation with Abu Bakr once she has died. He sends for Abu Bakr, and Abu Bakr comes to him. Ali says the family know Abu Bakr's excellence and what Allah has given him, and do not envy it, but that Abu Bakr had not consulted them, and they had thought they had a right in the matter because of their kinship to the Messenger (ﷺ). Abu Bakr weeps and says that kindness to the relatives of the Messenger (ﷺ) is dearer to him than kindness to his own. Ali gives him his pledge of allegiance that afternoon and praises Abu Bakr's right in public. The Muslims are glad and draw close to Ali again. The same report begins with Fatima's request about her inheritance; that part is discussed on the page "Was Fatima angry with Abu Bakr?".
What Ali said of Abu Bakr and Umar
Ali's son, Muhammad ibn al-Hanafiyya, once asked his father who were the best people after the Prophet (ﷺ). Ali said: Abu Bakr, then Umar. When asked "then you?", he said he was only one of the Muslims (Bukhari 3671). When Umar died, Ali stood by his body and prayed for him. He said he had always hoped Allah (﷾) would place Umar with his two companions. He had often heard the Prophet (ﷺ) say: I, Abu Bakr and Umar went; I, Abu Bakr and Umar entered (Bukhari 3685).
Ali's son Ibn al-Hanafiyya asked his father who the best of people were after the Messenger of Allah (ﷺ). Ali answered Abu Bakr, then Umar. Afraid that Ali would name Uthman next, he asked: then you? Ali replied that he was only a man among the Muslims.
Ibn Abbas reports that when Umar's body was laid out and the people prayed for him, Ali came, asked Allah's mercy for Umar and said that no one's deeds were dearer to him to meet Allah with than Umar's. Ali said he had always thought Allah would place Umar with his two companions, because he often heard the Prophet (ﷺ) say: I, Abu Bakr and Umar went; I, Abu Bakr and Umar entered.
Ali and Uthman
When Umar was dying, he named six men to choose a caliph. The choice came down to Uthman and Ali. Each promised to obey the other if the other was chosen. Uthman was chosen, and Ali gave him his pledge (Bukhari 3700). Later some blamed Uthman for sending out one standard copy of the Qur'an. Ali told them to speak only good of him. He said Uthman had acted after consulting the Companions. Had Ali been in charge, he said, he would have done the same.
In the long report of Umar's death, Umar names six men to choose among themselves. The choice comes down to Uthman and Ali, and Abd al-Rahman ibn Awf asks each in turn to promise that he will do justice if chosen, and listen and obey the other if the other is chosen. Both agree. Abd al-Rahman pledges to Uthman, and Ali gives him the pledge of allegiance, then all the people of Medina do. The report opens a few days before his death: Umar checks that the tax set on the land of Iraq is not more than it can bear, and says that if Allah keeps him alive, the widows of Iraq will never need a man to support them. Then he is stabbed as he begins the dawn prayer.
Suwayd ibn Ghafala reports that Ali said to speak only good of Uthman about the copies of the Qur'an, because he acted only after consulting the Companions, and that had Ali been in charge he would have done the same. Ibn Hajar calls the chain of this report sound.
When Ali ruled
When Uthman was killed in 656, the people came to Ali and begged him to accept their pledge. At first he refused. He accepted only when they pressed him, fearing for Islam. He did not seek power. As caliph he followed the Qur'an and the Sunnah, as the three before him had. The Prophet (ﷺ) told Muslims to hold to his Sunnah and the Sunnah of the rightly guided caliphs after him (Tirmidhi 2676).
Al-Tabari records that after Uthman was killed the people thronged to Ali and asked to pledge to him, saying they feared for Islam. Ali at first declined, and the people raised their voices and urged him until he accepted.
Al-Irbad ibn Sariya reports a farewell exhortation of the Messenger of Allah (ﷺ), after which the eyes wept and the hearts trembled. He told them to fear Allah, to listen and obey, and warned of much disagreement to come. He said whoever lives will see it, so hold to my Sunnah and the Sunnah of the rightly guided caliphs, and beware of newly invented matters.
A true prophecy: thirty years, then kingship
The Prophet (ﷺ) said the caliphate of prophecy would last thirty years. After that, Allah (﷾) would give the kingdom to whom He wills (Abu Dawud 4646). His Companion Safina, who reported it, counted it out: Abu Bakr two years, Umar ten, Uthman twelve, then Ali. Scholars such as Ibn Kathir add the six months of Ali's son al-Hasan. The Prophet (ﷺ) died in 11 AH (632 CE). Al-Hasan handed over rule in 41 AH (661 CE). That is thirty years by the Islamic calendar, as he said. Then came kingship. Mu'awiya founded the Umayyad dynasty and named his own son Yazid to follow him. From then on, rule passed down within one family. The Prophet (ﷺ) foretold this decades before it happened, and it came true. His words also count Ali among the rightly guided caliphs.
Safina reports that the Prophet (ﷺ) said the caliphate of prophecy will last thirty years, after which Allah gives the kingdom to whom He wills. Safina told the narrator to count Abu Bakr's caliphate as two years, Umar's as ten, Uthman's as twelve, and then Ali's. When it was said that some deny Ali was a caliph, Safina strongly rejected this.
Explains that the thirty years of the caliphate of prophecy are counted as the rule of Abu Bakr, Umar, Uthman and Ali, together with the six-month caliphate of al-Hasan ibn Ali, and names Ibn Kathir (al-Bidaya), al-Qadi Iyad (al-Shifa), Ibn Hajar al-Haytami and Ibn Abi al-'Izz among the scholars who say so.
Gives the reigns as Abu Bakr 632-634, Umar 634-644, Uthman 644-656 and Ali 656-661. Abu Bakr was the only one of the four not to die by assassination. Umar was assassinated in 644 while leading the morning prayer. Rebels besieged Uthman's house in Medina and killed him in June 656. Ali was assassinated in 661 by the Kharijite Abd al-Rahman ibn Muljam.
A study of the first caliphate. It describes how al-Hasan ibn Ali, after his father's death, gave up the rule to Mu'awiya in 41 AH (661 CE) on negotiated terms, ending the first civil war among the Muslims.
Describes the Umayyads as the first great Muslim dynasty to rule the empire of the caliphate (661-750). Its founder, Mu'awiya I, named his son Yazid as his successor, and rule then passed within the family.
- 632 to 634
Abu Bakr
Two years, as Safina counted.
- 634 to 644
Umar
Ten years.
- 644 to 656
Uthman
Twelve years.
- 656 to 661
Ali
About four and a half years.
- 661
Al-Hasan
About six months. The thirty years are complete.
- From 661
Kingship
Mu'awiya founds the Umayyad dynasty, and rule passes down within one family.
The Prophet (ﷺ) said the caliphate of prophecy would last thirty years, then Allah (﷾) would give the kingdom to whom He wills.
What might have been
No one can know how history would have gone in another order. In the prophecy of thirty years, the Prophet (ﷺ) described their rule together as one rightly guided caliphate. Asking which of them should have come first divides what he joined. Muslims love Ali as the Prophet's (ﷺ) cousin, son-in-law and one of his closest Companions. They love Abu Bakr, Umar and Uthman too, as Ali did.
Safina reports that the Prophet (ﷺ) said the caliphate of prophecy will last thirty years, after which Allah gives the kingdom to whom He wills. Safina told the narrator to count Abu Bakr's caliphate as two years, Umar's as ten, Uthman's as twelve, and then Ali's. When it was said that some deny Ali was a caliph, Safina strongly rejected this.
Al-Irbad ibn Sariya reports a farewell exhortation of the Messenger of Allah (ﷺ), after which the eyes wept and the hearts trembled. He told them to fear Allah, to listen and obey, and warned of much disagreement to come. He said whoever lives will see it, so hold to my Sunnah and the Sunnah of the rightly guided caliphs, and beware of newly invented matters.
Perspectives
Some Muslims believe the Prophet (ﷺ) named Ali as his successor
Some Muslims, out of love for the Prophet's (ﷺ) family, believe the Prophet (ﷺ) named Ali to lead after him. So they say Ali should have been the first caliph.
At Ghadir Khumm the Prophet (ﷺ) said: of whomever I am the mawla, Ali is his mawla.
Rebuttal
The saying is real, and it calls for love and support of Ali. The word mawla means friend, helper and protector. It does not say Ali is the ruler after him. Ali himself gave his pledge to Abu Bakr, Umar and Uthman, and praised them.
Ali felt the family had a right in the matter.
Rebuttal
He felt they should have been consulted, and said so. In the same meeting he praised Abu Bakr's excellence, gave his pledge and declared Abu Bakr's right in public. He later named Abu Bakr and Umar as the best people after the Prophet (ﷺ).
The Islamic perspective
The community chose Abu Bakr, and Ali gave his pledge to him and to Umar and Uthman. Ali praised them, and ruled by the same Qur'an and Sunnah. All four were rightly guided caliphs.
Ali gave his pledge to Abu Bakr and praised his right in public.
Ali named Abu Bakr and then Umar as the best people after the Prophet (ﷺ).
Ali said he would have done what Uthman did with the copies of the Qur'an.
The Prophet (ﷺ) foretold that the caliphate of prophecy would last thirty years, then become kingship, and it came true.