Firstly, Mu'awiyah (radiallahu anhu) is considered by sunnis as first king of muslims though he was called khalifah. The word "khalifah" simply means successor. The Permanent Committee for Scholarly Research and Verdicts were asked the question:
The Prophet (sallallaahu alayhi wasallam) said: "The khilaafah after me is thirty years, then there will be biting kingship" and for this reason Mu'aawiyah said, "I am the first of the kings", from the risaalah of Abi Zayd al-Qayrawaanee (1/96). What is the meaning of this hadeeth?
This hadeeth has been related by Imaam Ahmad in al-Musnad, al-Haakim
in al-Mustadrak, Abu Ya'laa in al-Musnad, Ibn Hibbaan in his Saheeh
and at-Tirmidhee in as-Sunan. And the meaning of the hadeeth has been
explained by al-Haafidh (Ibn Hajar) in al-Fath, he said:
He meant by the khilaafah, the khilaafah of prophethood (i.e. the thirty years), and as for Mu'aawiyah and whoever came after him, then
they were upon the way of the kings (i.e. kingship) even if they are
named "khalifahs (successors)".
There are also other narrations confirming this:
The hadeeth narrated by Safeenah (radiallaahu anhu), that the Prophet (sallallaahu alayhi wasallam) said:
خلافة النبوة ثلاثون سنة ثم يؤتي الله الملك من يشاء
The Prophetic khilaafah will last for thirty years. Then Allaah will give the dominion to whomever He wills. Reported by Abu Dawud and al-Haakim. Saheeh al-Jaami' as-Sagheer (no. 3257) declared Saheeh by Imaam al-Albaani (rahimahullaah).
And in the Sunan of Abu Dawud, there occurs after this hadeeth, what is said by Sa'eed bin Jamhaan, who narrated from Safeenah:
قال سفينة: امسك، خلافة أبي بكر رضي الله عنه سنتين، وعمر رضي الله عنه
عشراً، وعثمان رضي الله عنه اثنتي عشر، وعلي ستّاً
Safeenah said (to me): Hold on (meaning, listen), the khilaafah of Abu Bakr (radiallaahu anhu) was two years, and [that of] Umar
(radiallaahu anhu) was ten years, and [that of] Uthmaan (radiallaahu
anhu) twelve years, and [that of] Alee (radiallaahu anhu) six years.
Abu Dawud, Kitaab us-Sunnah, Chapter on the Khulafaa, (no. 4647).
Also reported by Safeenah, the saying of the Prophet (sallallaahu alayhi wasallam):
الخلافة بعدي في أمتي ثلاثون سنة ثم ملك بعد ذلك
The khilaafah after me in my Ummah will last for thirty years. Then there will be kingship after that. Reported in the Musnad Imaam Ahmad, by at-Tirmidhi, Musnad Abi Ya'laa, and Ibn Hibbaan. Saheeh al-Jaami' as-Sagheer (no. 3341) declared Saheeh by Imaam al-Albaani (rahimahullaah).
Shaykh ul-Islaam Ibn Taymiyyah explains (Majmoo' 10/354):
The kingship of Mu'aawiyah was one of mercy, and when Mu'aawiyah
departed - may Allaah's mercy be upon him - and the leadership of
Yazeed came, and there occured therein the tribulation of the killing
of Husain in Iraq, and the fitnah of the people of Harrah in Madinah,
and the siege of Makkah, when Abdullah bin Zubayr made his stand. Then
Yazeed passed away and the Ummah split, Ibn az-Zubayr in the Hijaaz,
Banu al-Hakam in Shaam, and al-Mukhtaar bin Abee Ubayd seizing power
in Iraaq. All of this took place at the end of the period of the
Companions, when there only remained the likes of Abdullah ibn 'Abaas,
Abdullah ibn Umar, Jaabir ibn 'Abdullah, Abu Saeed al-Khudree and
Secondly, regarding Mu'awiyyah (radiallahu anhu) he was one of the Prophet's Sahabah (Companions) and one of the scribes who wrote down the Revelation.
Thirdly, coming to the claim of caliphate, Mu'awiyah(radiallahu anhu) did not claim the caliphate for himself and the Ba'yah (pledge of allegiance) was not made to him when he was fighting against Ali (radiallahu anhu). He did not fight Ali(radiallahu anhu) because he considered himself to be the rightful caliph or that he thought he deserved to be. Neither he nor his supporters wanted to initiate a fight with Ali (radiallahu anhu), it was only when Ali(radiallahu anhu) told them to swear allegiance and obedience to him, so there would not be two caliphs, that they refused their obedience. It was then that Ali(radiallahu anhu) had no alternative but to fight them, to force them to obey him and maintain the Muslim community, as Mu`awiyyah and his supporters were saying that this was not obligatory for them until Uthman's (radiallahu anhu) rights had been taken from those in Ali's army who had rebelled and killed him.
The following is evidence that Mu’awiyah’s true goal was not to become the caliph, but rather, his right for avenging Uthman.
From Siyar A’alam Al-Nubala:
وقالوا: أنت تنازع عليا أم أنت مثله ؟ فقال: لا والله، إني لاعلم أنه
أفضل مني وأحق بالامر مني، ولكن ألستم تعلمون أن عثمان قتل مظلوما، وأنا
ابن عمه، والطالب بدمه، فائتوه، فقولوا له، فليدفع إلي قتلة عثمان، وأسلم
له. فأتوا عليا، فكلموه، فلم يدفعهم إليه
Rough translation: Al-Ju’fi (Yahya bin Sulaiman, from his book
“Siffeen”): Ya’la bin Ubaid, from his father: Abu Muslim Al-Khawlani
and a group of people entered upon Mu’awiyah, and they asked, “Do you
dispute Ali? Are you his equal?” He replied, “No, I am not, and I know
that he is better than me, and deserves this (khilafa) more than me,
but don’t you know that Uthman was killed unjustly, and that I am his
cousin, and that I ask for his blood? So go to him (Ali), and tell him
to bring forth the killers of Uthman, and I will submit to him.” So,
they went to Ali, and spoke to him, but he didn’t hand them (the
Same narration can be found in Shia sources. See Waq’at Siffeen by Nasr bin Muzahim:
إن أبا مسلم الخولانى قدم إلى معاوية في أناس من قراء أهل الشام، [ قبل مسير أمير المؤمنين عليه السلام إلى صفين، ] فقالوا [ له ]: يا
معاوية علام تقاتل عليا، وليس لك مثل صحبته ولا هجرته ولا قرابته ولا
سابقته ؟ قال لهم: ما أقاتل عليا وأنا أدعى أن لى في الإسلام مثل صحبته
ولا هجرته ولا قرابته ولا سابقته، ولكن خبروني عنكم، ألستم تعلمون أن
عثمان قتل مظلوما ؟ قالوا: بلى.
قال: فليدع إلينا قتلته فنقتلهم به، ولا قتال بيننا وبينه.
Rough translation: And Abu Muslim Al-Khawlani came to Mu’awiya with a group of qura’a from the people of Al-Shaam, before Ali went to
Siffeen. They said, “Why do you fight Ali? You are not in his level of
suhba or hijra or closeness or earliness (in Islam). He said, “I don’t
fight Ali with the claim that I am like him in suhba, hijra, closeness
or earliness, but tell me, aren’t you aware that Uthman was killed
unjustly?” They said, “Yes.” He said, “They if he gives us the
killers, we’ll kill them, and there will be nothing between us and him
Also, interestingly, the following, by Al-Tabari implies that Mu’awiyah was never seen as a caliph, until after the death of Ali, nor was he given bay’a:
(وفى هذه السنة) بويع لمعاوية بالخلافة بايلياء حدثنى بذلك موسى بن عبد
الرحمن قال حدثنا عثمان بن عبد الرحمن قال أخبرنا اسماعيل بن راشد وكان
قبل يدعى بالشأم أميرا وحدثت عن أبى مسهر عن سعيد بن عبد العزيز قال كان
على عليه السلام يدعى بالعراق أمير المؤمنين وكان معاوية يدعى بالشأم
الامير فلما قتل على عليه السلام دعى معاوية أمير المؤمنين
Rough translation: In this year, Mu’awiyah was given baya’a in Ilya’a. Musa bin Abdulrahman said that Uthman bin Abdulrahman said,
Isma’eel bin Rashid told us that “he (Mu’awiyah) used to be called the
ameer of Al-Shaam.” I was told that Abu Mushir that Sa’eed bin
Abdulaziz said, “Ali used to be called Ameer Al-Mu’mineen in Iraq, and
Mu’awiyah was called the ameer in Al-Shaam, but when Ali was killed,
Mu’awiyah was later called Ameer Al-Mu’mineen.”
Also notice that Al-Tabari didn’t say that Mu’awiyah was given baya’a before this year. This implies that nobody gave Mu’awiyah a baya’a for the khilafa before this time.
Ibn Katheer also says,
“When Ali died, the people of Al-Shaam pledged their allegiance to
Mu’awiyah, as the Ameer Al-Mu’mineen, for there was nobody that could
The belief of Ahlus Sunnah is that the Khilafaah and Immamate can be achieved in several ways: (1) Either by choosing the person who is most qualified and best positioned for it, as was the case with Abu Bakr As-Siddeeq, may Allah be pleased with him; or it can be achieved by (2) the former leader passing it onto his successor, as was the case when Abu Bakr delegated the authority over to 'Umar; or it may occur by (3) delegating the matter to a specified group of well-known individuals to choose someone among them, as was the case with when 'Umar delegated the authority to the people of the Shoora (Committee). Then when 'Uthmaan was martyred, the people gave oath of allegiance to Ali. Or leadership can be obtained by victory through battle, as it was case with Banu Umayyah. [From Beneficial Answers to Questions on Innovated Methodologies]
So, when Ali martyred, Mu'awiyah was given oath of allegiance by people of Shaam as Ameer Al-Mu'mineen. Hence, it is perfectly legitimate.
This is the view of the Sunni Muslims.
Sources: The Khilaafah Lasted for 30 Years Then There Was Kingship Which Allaah Gives To Whomever He Pleases,
Regarding the 'Khalifahs' After the Khilaafah of Prophethood that Lasted 30 Years
,Mu’awiyah’s Claim for the Caliphate,
Matters related to the Sahabah,