I was traveling with the Prophet ﷺ when he heard a man reciting "Say, disbelievers" [Kafirun 109:1] until he finished the surah.The Prophet ﷺ said, "This man has freed himself of shirk."Then we went on, and he heard another man reciting "Say, He is Allah, One" [Ikhlas 112:1].He said, "As for this one, he has been forgiven."
كنت أسير مع النبي ﷺ فسمع رجلا يقرأ: {قل يا أيها الكافرون} حتى ختمها، قال: قد برئ هذا من الشرك، ثم سرنا، فسمع آخر يقرأ: {قل هو الله أحد} فقال: أما هذا فقد غفر له.
Ahmad (16605, 16617), Nasai in Kubra (7974), and Darimi in his Musnad (3469) all narrated it through various routes from Abu Hasan Muhajir the Goldsmith, from a man among the companions of the Prophet ﷺ, who said, and then he related it. Its chain of transmission is sahih.