Sahih Muslim Book 004, Hadith Number 1110.

Chapter : It is allowable to curse Satan during prayer and seek the protection (of the Lord) and minor acts (of commission) in prayer.

Abu Qatada reported: As we were sitting in the mosque, the Messenger of Allah (may peace be upon him) came to us, and the rest of the Hadith is the same except that he made no mention that he led people in this prayer.

Related Hadith(s)