Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates this as a marfu' hadith (attributed to the Prophet) that the Prophet (peace and blessings be upon him) said: "Prompt those of you who are on the verge of death to say 'La ilaha illallah', for the soul of the believer comes out with sweat, while the soul of the disbeliever comes out from the corners of his mouth, just as the soul of a donkey comes out."
Al-Tabarani recorded it in al-Mu'jam al-Kabir. Its chain is hasan (good).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجنائز / 3915
Hadith Gradingمحدثین:إسنادہ حسن۔
Hadith Takhrij«أخرجه المعجم الكبير للطبراني برقم: 10015، 10417، وأخرجه المعجم الأوسط للطبراني برقم: 5898»