Mu'awiya ibn Abi Sufyan became sole caliph in 41 AH (661 CE) when al-Hasan ibn Ali (ra) made peace with him and handed over authority, ending the civil war that followed the murder of Uthman. He was not chosen by a council, as Abu Bakr, Umar, Uthman and Ali were, but by an agreement between the two armies, after which the people gave him their pledge.
- Background: Mu'awiya had governed Syria since the caliphate of Umar and refused to pledge to Ali until Uthman's killers were dealt with.
- The year of unity: after Ali's death in 40 AH the people of Kufa pledged to al-Hasan, who then agreed terms with Mu'awiya in 41 AH, a year known as 'am al-jama'a.
- The Prophetic report: the Prophet (saw) described al-Hasan as a leader through whom Allah would reconcile two great groups of Muslims (Sahih al-Bukhari 2704).
- Disputes: the exact terms of the agreement are reported differently, and Sunni and Shi'a historians evaluate his caliphate differently.
Introduction
The question asks how Mu'awiya was chosen. Unlike the first four caliphs, there was no meeting at which a ruler was selected. He took over by treaty after a conflict, and his later nomination of his son Yazid was a further turn that made the issue controversial. This answer gives the sequence of events, the terms as reported, the views of the early scholars and the points of dispute.
The main sources for the period are al-Tabari, Ibn Sa'd, al-Baladhuri, Ibn Kathir and Ibn al-Athir, together with the hadith collections. Some of the narratives, especially those transmitted by Abu Mikhnaf, are regarded by hadith scholars as weak, and I have limited this account to points that are widely repeated, noting where the reports differ.
Mu'awiya before the caliphate
Mu'awiya was a Companion, a scribe of the revelation according to many reports, and a brother of Umm Habiba (ra), a wife of the Prophet (saw). He served under Abu Bakr and Umar. After his brother Yazid ibn Abi Sufyan died in the plague of Amwas in 18 AH, Umar (ra) appointed him governor of Damascus and later Syria, and he remained in office under Uthman (ra). He built a strong administration and a navy.
The civil war
After Uthman (ra) was killed in 35 AH, Ali (ra) was given the pledge in Madinah. Mu'awiya, as the cousin of Uthman, and the Syrians demanded that Uthman's killers be tried first, and they did not pledge to Ali until this was done. Ali (ra) said that order had to be restored before the cases could be heard. The two sides met at Siffin in 37 AH. The fighting ended in an arbitration, which led to the secession of the Khawarij from Ali's camp. In 40 AH a Khariji, Abd al-Rahman ibn Muljam, killed Ali (ra) in Kufa during Ramadan.
The pledge to al-Hasan and the treaty
After Ali's death, the people of Kufa gave the pledge to his son al-Hasan (ra). The sources say that al-Hasan had his army march to meet the Syrians but was reluctant to continue the fighting, in view of the divisions in his ranks and the cost in lives. He negotiated with Mu'awiya, and in 41 AH he handed over authority. The two met in Kufa, and the people of Iraq and the Hijaz pledged to Mu'awiya. That year was named the Year of the Community ('am al-jama'a).
The Prophet (saw) had foretold this outcome. Abu Bakra (ra) reports that he saw the Prophet (saw) on the pulpit with al-Hasan beside him and heard him say:
إِنَّ ابْنِي هَذَا سَيِّدٌ وَلَعَلَّ اللَّهَ أَنْ يُصْلِحَ بِهِ بَيْنَ فِئَتَيْنِ عَظِيمَتَيْنِ مِنَ الْمُسْلِمِينَ
This son of mine is a leader, and perhaps Allah will use him to reconcile two great groups of Muslims (Sahih al-Bukhari 2704, 3746)
Scholars such as Ibn Hajar commented that this hadith shows the virtue of al-Hasan (ra) and the merit of reconciliation, and it is used by Sunni scholars as a sign that the peace was approved by the Prophet (saw).
The terms
The reports on the terms vary. Some say that al-Hasan stipulated that Mu'awiya should follow the Book of Allah and the Sunnah of the Prophet (saw), that the caliphate should return to al-Hasan or be decided by consultation after Mu'awiya, and that the people should be secure. Other accounts mention financial conditions. The statement that the rule would go back to al-Hasan after Mu'awiya is found in some reports and is rejected by others, and the reviewer should be aware that modern historians do not agree on these details. It is not safe to cite a list of terms as established fact.
Later developments
Mu'awiya ruled for about twenty years until 60 AH. Around 56 AH he secured pledges for his son Yazid as heir, which was criticised by a number of the Companions' sons, including Abd al-Rahman ibn Abi Bakr, Abd Allah ibn Umar, al-Husayn and Ibn al-Zubayr, according to the reports. The change from consultation to hereditary succession was seen by many scholars as the point where the caliphate took on the character of a monarchy, though others defend Mu'awiya's judgement that this avoided new strife.
How scholars view it
Sunni scholars generally accept the legitimacy of Mu'awiya's rule after 41 AH because of the reconciliation and the pledge of the community, and they forbid cursing the Companions. A hadith states that the caliphate after the Prophet (saw) would last thirty years and then become kingship (reported by Abu Dawud 4646 and al-Tirmidhi 2226, who considered it hasan; its authenticity has been accepted by many and questioned by a few). Scholars such as Ibn Taymiyya explained it as meaning that the rightly guided caliphate ended with al-Hasan's peace, and that Mu'awiya was the first of the kings and the best of them, while others, including some historians, criticised aspects of his rule such as the nomination of Yazid.
The Shi'a tradition regards Ali and his sons as the rightful Imams and does not accept Mu'awiya's rule. These differences are old and the reviewer should present them respectfully and with the sources of each view.
Reading the sources with care
Anyone researching this period should note that the oldest and fullest narrative accounts were written down in the second and third centuries after the Hijra, and that they reflect the sympathies of their narrators. Reports that come through Abu Mikhnaf and similar narrators tend to be dramatic and are treated with caution by hadith critics, while reports in the Sahih collections are brief but carefully verified. A sound approach is to start with the sound reports, then use the histories for context, and to be slow to accept any claim about private motives that is not supported by a firm chain. Muslim scholars have long taught that silence about disputed matters is better than speculation, and some, such as Ahmad ibn Hanbal, are reported to have advised restraint in discussing the disputes among the Companions.
Live it
The reconciliation of al-Hasan is an example of putting the unity of the community above personal claims. A dua: Allahumma allif bayna qulubina wa aslih dhata baynina, 'O Allah, join our hearts and set right what is between us' (reported by Abu Dawud 969, graded weak by some; check before use). Reflection question: when have I given up something I was entitled to for the sake of peace?
Conclusion
Mu'awiya became caliph through the treaty of 41 AH, in which al-Hasan (ra) handed over authority to end the fighting, followed by the pledge of the community. The Prophet (saw) had praised that act of reconciliation. The details of the terms and the evaluation of Mu'awiya's later reign are disputed, and a careful answer reports the sources and does not claim certainty where there is none.
References
Sahih al-Bukhari 2704, 3746, 7109
Sunan Abi Dawud 4646; Jami' al-Tirmidhi 2226
Al-Tabari, Tarikh al-Rusul wa al-Muluk
Ibn Kathir, al-Bidaya wa al-Nihaya
Ibn Hajar, Fath al-Bari, commentary on Sahih al-Bukhari 2704
Ibn Taymiyya, Minhaj al-Sunna al-Nabawiyya