The Verse of Wilayah or Leadership (Arabic: آية الولاية, Āyat al-Wilāyah) is the 55th verse of the Al-Ma'ida Chapter (Surah 5) in the Quran. Both Sunni and Shia scholars accept that the verse alludes to the giving of alms (zakat) to the poor by Ali while he was bowing (in rukū‘) during prayer (ṣalāt), but only the Shia see it as bestowing the succession of Muhammad upon him.
إِنَّما وَلِيُّكُمُ اللَّهُ وَ رَسُولُهُ وَ الَّذِينَ آمَنُوا الَّذِينَ يُقِيمُونَ الصَّلاةَ وَ يُؤْتُونَ الزَّكاةَ وَ هُمْ راكِعُونَ
“Only Allah is your wali and His Apostle and those who believe, those who keep up prayers and pay the poor rate while they bow.” (Quran, 5:55)
The Treasure of the Doers of Good Deeds records the hadith handed down from Ibn Abbas:
Ali (A) gave someone his ring in alms while he was in the state of rukūʿ in prayer. The Prophet (S) asked the beggar, "Who gave you this ring?" He replied, "That man during rukūʿ." Then Allah sent down the verse, "Your master and guardian is only Allah, His Messenger, and those who believe, those who establish ṣalāt and pay zakāt while they are bowing in rukūʿ." On that was written, "Glory be to He who honored me by making me His slave." After that it was engraved on his ring that all power and authority belongs to Allah.
Many Shiite scholars narrates that the ring which Ali gave to that beggar was the ring of Prophet Sulayman. Most Muslim commentators accept that this event led to the revelation of the verse of Wilayah from the archangel Gabriel. In Shia accounts, the revelation was preceded by a repetition of the Hadith of Position, with Muhammad comparing his relationship with Ali to that between Moses and Aaron. Abu Dhar al-Ghifari, one of the earliest converts to Islam, was said to have related the following hadith to Ahmad ibn Muhammad al-Tha'labi, the Sunni author of the Tafsir al-Thalabi:
One day, I was praying with the Prophet in the mosque when a beggar walked in. No one responded to his pleas. The beggar raised his hands towards the heavens and said, "Allah! Be a witness that I came to the Prophet's mosque and no one gave me anything." Imam Ali (a) was bowing (rukūʾ) during his prayer at that time. He pointed his little finger, on which was a ring, towards the beggar who came forward and took away the ring. The incident occurred in the Prophet's presence, and he raised his face towards heaven and prayed:
"O Lord! my brother Musa had begged of Thee to open his breast and to make his work easy for him, to loosen the knot of his tongue so that people might understand him, and to appoint from among his relations his brother, as his wali, and to strengthen his back with Harun and to make Harun his partner in his work. O Allah! Thou said to Musa, 'We will strengthen thy arm with thy brother. No one will now have access to either of you!' O Allah! I am Muhammad and Thou hast given me distinction. Open my breast for me, make my work easy for me, and from my family appoint my brother Ali as my wali. Strengthen my back with him."
In one Shia authority, the revelation of this verse was followed by the Hadith of the Pond of Khumm, whereby Muhammad stated that "For whomever I am the mawla [synonymous with wali], Ali is his mawli."
The core meaning of the word wali is "guardian", but it has the extended senses of helper, friend, assistant, confederate, son-in-law, leader, and master. In this passage, it has been understood in the sense of "helper" and "friend" but is usually taken as referencing mastery or leadership (wilayah). The surrounding verses advise Muslims not to take Jews or Christians as their walis, which has caused some to view it as discussing a social restriction on friendships, but it is more properly understood in light of the hadith concerning Ali in both Sunni and Shia interpretation.
The only (إِنَّما, innama) leaders permitted by the verse are God and Muhammad and those who believe Islam (i.e. Muslims). The end of the verse is usually understood as restricting the believers who qualify as leaders: only Muslims who keep up their daily prayers and pay alms while bowing are permissible as walis. More specifically, the Shia consider the intent of the verse to be restricted to Ali and the Imams who followed him.
The status and meaning of this event is a matter of discussion amongst scholars of Islam. Sunni and Shia scholars agree that the verse was narrated in honour of Ali, but there are differing interpretations of wilayah and the Imamate. The Sunni scholars believe that the verse is about Ali but does not recognise him as an imam while, in the Shia Muslim view, Ali had been chosen by God as successor of Muhammad. According to the Shia, imams are selected by God, which is known through the declaration of Muhammad or a previous imam, while the Sunni believe that imams and caliphs come to power in numerous ways, whether through selection by the previous leader or a committee or through usurpation of the office.