Sunan an-Nasa'i
Grading supplied with this record: Sahih (Darussalam)
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
إِذَا نُودِيَ لِلصَّلاَةِ أَدْبَرَ الشَّيْطَانُ وَلَهُ ضُرَاطٌ حَتَّى لاَ يَسْمَعَ التَّأْذِينَ فَإِذَا قُضِيَ النِّدَاءُ أَقْبَلَ حَتَّى إِذَا ثُوِّبَ بِالصَّلاَةِ أَدْبَرَ حَتَّى إِذَا قُضِيَ التَّثْوِيبُ أَقْبَلَ حَتَّى يَخْطِرَ بَيْنَ الْمَرْءِ وَنَفْسِهِ يَقُولُ اذْكُرْ كَذَا اذْكُرْ كَذَا لِمَا لَمْ يَكُنْ يَذْكُرُ حَتَّى يَظَلَّ الْمَرْءُ إِنْ يَدْرِي كَمْ صَلَّى "
It was narrated from Abu Hurairah that the Prophet (ﷺ) said:
"When the call for the prayer is given, the Shaitan takes to his heels, passing wind loudly so that he will not hear the call to prayer. When the call to prayer is finished, he comes back. And when the Iqamah is said, he again takes to his heels, and after it is completed, he returns again to interfere between the (praying) person and his heart, saying to him: 'Remember such and such, remember such and such,' - things that he had not remembered - until he does not know how many (Rak'ahs) he has prayed."
Full reference and source
Sunan an-Nasa'i English : Vol. 1, Book 7, Hadith 671 Arabic : Book 7, Hadith 678
View source on Sunnah.com (opens in a new tab)