In Abrahamic faiths, the concept of pledging allegiance to the messenger holds significant importance. The messenger referred to in this context is typically the Prophet Mohammed (PBUH & His Family) in Islam, but similar ideas exist in Judaism and Christianity regarding their respective prophets or messengers.
In Islam, pledging allegiance to the messenger refers to the act of expressing loyalty and obedience to Prophet Muhammad as the final messenger of God. This allegiance is manifested through the declaration of faith known as the Shahada, which states, "There is no god but Allah, and Mohammed is the Messenger of Allah." And it is well known that the people pledged their allegiance to the Prophet (PBUH & His Family).
“Indeed, Allah was pleased with the believers when they pledged allegiance to you ˹O Prophet˺ under the tree. He knew what was in their hearts, so He sent down serenity upon them and rewarded them with a victory at hand.” - Surah Al-Fath Verse 18
“O Prophet! When the believing women come to you, pledging to you that they will neither associate anything with Allah ˹in worship˺, nor steal, nor fornicate, nor kill their children, nor falsely attribute ˹illegitimate˺ children to their husbands, nor disobey you in what is right, then accept their pledge, and ask Allah to forgive them. Surely Allah is All-Forgiving, Most Merciful.” - Surah Al-Mumtahanah, Verse 12
It has been reported on the authority of Nafi, that 'Abdullah b. Umar paid a visit to Abdullah b. Muti' in the days (when atrocities were perpetrated on the People Of Medina) at Harra in the time of Yazid b. Mu'awiya.
Ibn Muti' said:
Place a pillow for Abu 'Abd al-Rahman (family name of 'Abdullah b. 'Umar). But the latter said: I have not come to sit with you. I have come to you to tell you a tradition I heard from the Messenger of Allah (PBUH & His Family). I heard him say: One who withdraws his band from obedience (to the Amir) will find no argument (in his defence) when he stands before Allah on the Day of Judgment, and one who dies without having bound himself by an oath of allegiance (to an Amir) will die the death of one belonging to the days of Jahillyya, ignorance.
- Sahih Muslim 1851a
And there are narrations that state that pledging allegiance to the Mahdi is a divine obligation upon the people.
From Thawban that the Prophet of Allah (PBUH & His Family) said:
“Three will fight at your treasure, all of them are the sons of a caliph, then it will not be to anyone of them, then the black banners will rise from the east, and they will fight a fight that no nation has fought before”. Then he mentioned something and said: “If you see him, pledge allegiance to him even if crawling on ice, verily he is the Caliph of Allah the Mahdi”.
– Al-Mostadrak A’ala Al-Saheehayn, Abi Abdillah Muhammad Al-Hakim Al-Naysabory, v.4, p.510, hadith 8432 (Online book: p. 464), Kanz Al-Ummal, Al-Muttaqi Al-Hindi, v.14, p.263, hadith 38658, Sunan Ibn Maja, Muhammad ibn Yazeed Al-Qozweeny, v.2, p.1367, hadith 4084
Abdullah ibn Mas’ud narrated that the Messenger of Allah (PBUH & His Family) said:
“While we were with the Messenger of Allah (PBUH & His Family), some youth from Banu Hashim approached. When the Prophet (PBUH & His Family) saw them, his eyes filled with tears and his color changed. I said: ‘We still see something in your face that we do not like (to see).’ He said: ‘We are members of a Household for whom Allah has chosen the Hereafter over the dunya (this world) and verily, my Ahlulbayt will face calamity, expulsion and exile after me, until a group of people will come from the East and with them are the black banners. They will ask for the truth/right but will not be given it, so they will fight and will be victorious. Then they are given what they have asked but they do not accept it, until they push it to a man from my Ahlulbayt so he fills it with justice and equity just as they filled it with oppression. Whoever lives to see that, let him go to them even if crawling over ice”.
– Sunan Ibn Maja, Muhammad ibn Yazeed Al-Qazweeny, v.2, p.1366, hadith 4082
– Bihar Al-Anwar, Muhammad Baqir Al-Majlisi, 3rd ed., v.51, p.82-83, hadith 27
For the Shia Muslims, there is a well-known supplication called, Dua Ahad, which is a Supplication of Allegiance (Ahad) to Imam Mahdi (PBUH & His Family). In it the supplicant say,
allahumma inni ujaddidu lahu fi sabihati yawmi hadhaO Allah, I update to him in the beginning of this day
وَمَا عِشْتُ مِنْ أَيَّامِي
wa ma `ishtu min ayyami
and throughout the days of lifetime a pledge,
عَهْداً وَعَقْداً وَبَيْعَةً لَهُ فِي عُنُقِي
`ahdan wa `aqdan wa bay`atan lahu fi `unuqi
a covenant, and allegiance to which I commit myself
لا أَحُولُ عنها وَلا أَزُولُ أَبَداً
la ahulu `anhu wa la azulu abadan
and from which I neither convert nor change.
- Dua Ahad
And Prophet Mohammed (PBUH & His Family) said:
“Whoever dies and doesn’t pledge allegiance to the Imam of his time has died the death of ignorance." - Al-Aql wa Al-Jahl fi Al-Kitab wa Al-Sunnah, Mohammed Al-Reyshahri, p. 275