(And (there are) others who have acknowledged their faults…) [9:102-103].
Ibn al-Walibi reported that Ibn 'Abbas said: “This verse was revealed about some people who failed to join the Messenger of Allah, Allah bless him and give him peace, at the Battle of Tabuk and then regretted it, saying: 'We are enjoying shelter and shade with the women while the Messenger of Allah, Allah bless him and give him peace, and his Companions are engaging in Jihad. By Allah, we shall tie ourselves to the columns [of the mosque] and remain tied until the Messenger himself unties and pardons us'. And they tied themselves to the columns of the mosque. When the Messenger of Allah, Allah bless him and give him peace, returned from the battle, he passed by them and asked about who they were. He was told: 'These are the people who failed to join you. They vowed to remain in their position until you untie them yourself'. The Prophet, Allah bless him and give him peace, said: 'And I swear that I will not set them free until I am commanded to do so nor will I pardon them unless it is Allah Who pardons them first. They have failed to join me and shunned fighting alongside the Muslims'. And so Allah, exalted is He, revealed this verse. When it was revealed, the Messenger of Allah, Allah bless him and give him peace, sent for them, freed them and pardoned them. When they were freed, they said: 'O Messenger of Allah, these are our riches which caused us to fail to join you, spend them on charity on our behalves to purify us and ask forgiveness for us'. He said: 'I was not commanded to take anything from your riches'. Allah, glorious and majestic is He, then revealed (Take alms of their wealth, wherewith thou mayst purify them and mayst make them grow…) [9:103]”.
Said Ibn 'Abbas: “They were ten men”.
Asbab Al-Nuzul by Al-Wahidi , trans. Mokrane Guezzou