Two men brought a dispute before the Prophet ﷺ. The Prophet ﷺ asked the claimant for evidence, but he had none, so the defendant was required to take an oath. He swore, "By Allah, beside whom there is no god."The Messenger of Allah ﷺ then said, "Indeed, you did do it, but you have been forgiven because of your sincere declaration that there is no god but Allah."Abu Dawud said, what is meant by this hadith is that he did not command him to make any expiation.
أن رجلين اختصما إلى النبي ﷺ فسأل النبي ﷺ الطالب البينة. فلم تكن له بينة. فاستحلف المطلوب. فحلف بالله الذي لا إله إلا هو. فقال رسول الله ﷺ: بلى قد فعلت، ولكن قد غفر لك بإخلاص قول لا إله إلا الله قال أبو داود: يراد من هذا الحديث أنه لم يأمره بالكفارة.
This was narrated by Abu Dawud (3275), Ahmad (2280), and Bayhaqi (10/37), all from the hadith of Hammad bin Salama, from Ata bin Saaib, from Abu Yahya, from Ibn Abbas, who related it.Nasai narrated it in Kubra (6006) via the route of Sufyan Thawri from Ata bin Saaib, with the wording, "Pay off what he is owed, and 'there is no god but Allah' will atone for what you did." Ata bin Saaib became confused in his memory toward the end of his life, so whoever heard from him in his earlier period, his hadith is sahih, as Ahmad and others have said. Shuba, Sufyan, and Hammad bin Salama heard from him in his earlier period, so their hadith is sahih. Ahmad bin Hanbal, Ibn Main, and others stated this explicitly.These hadiths were used as evidence by those who held that whoever vows to commit a sinful act should not fulfill the vow, and no atonement is due from him. This is the position of Malik, Shafii, Abu Thawr, and others, because a vow to commit a sin is not binding, so no atonement is required for it.