(O ye who believe! Betray not Allah and His messenger…) [8:27].
This verse was revealed about Abu Lubabah ibn ‘Abd al-Mundhir al-Ansari. What happened is that the Messenger of Allah, Allah bless him and give him peace, besieged the Jews of Banu Qurayzah for 21 nights when they requested peace from the Messenger of Allah, Allah bless him and give him peace, on the same terms that their brothers from Banu’l-Nadir had secured before, i.e. that they join their brothers in Adhri‘at and Jericho in Syria. But he refused to grant it to them and insisted that they submit to the judgment of Sa‘d ibn Mu‘adh. They refused to do so and said: “Send us Abu Lubabah, instead”. Abu Lubabah was loyal to them, for his property, wife and children were with them. When the Messenger of Allah, Allah bless him and give him peace, sent him to them, they said to him: “O Abu Lubabah, what do you think we should do? Should we accept the judgment of Sa‘d ibn Mu‘adh?” Abu Lubabah made a gesture to his throat, i.e. that they should not do it, for they will be slaughtered. Abu Lubabah said: “I straightaway realised that I had betrayed Allah and His Messenger”. And then this verse was revealed about him. When the verse was revealed, Abu Lubabah tied himself to one of the columns of the mosques and said: “By Allah, I will not taste food or drink until Allah relents on me or I die”. He remained in this state for seven days, neither eating nor drinking, until Allah, exalted is He, relented on him. When it was said to him: “O Abu Lubabah! You have been pardoned”, he said: “By Allah, I will not untie myself; I want the Messenger of Allah, Allah bless him and give him peace, to untie me”. The Prophet went and untied him with his own hands. Abu Lubabah then said: “The completion of my repentance requires that I migrate from the abode of my people where I had committed the sin and that I let go of my property”. The Messenger of Allah, Allah bless him and give him peace, said to him: “It is enough that you give a third of it to charity”.
Asbab Al-Nuzul by Al-Wahidi , trans. Mokrane Guezzou