Abd al-Rahman bin Abi Layla al-Ansari (may Allah have mercy on him), of the people of Kufah, narrated that Sayyiduna Ka'b bin Ujrah (may Allah be pleased with him), the brother of Banu Salim, suffered an ailment of his head while he was besieged at al-Hudaybiyah with the Messenger of Allah (peace and blessings be upon him). The Messenger of Allah (peace and blessings be upon him) ordered him to fast three days, or feed six poor people, or slaughter a sheep, and it was concerning him that this verse was revealed.
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16266