Satan, when he hears the call to prayer, retreats breaking wind—because of the call’s overwhelming effect upon him. Then, when the call to prayer has ended, he returns; and when he returns, he comes to a person during his prayer, saying to him: “Remember such-and-such; remember such-and-such”—things he had not previously remembered—until he no longer knows how many units of prayer he has performed. (1) This hadith explicitly states that intrusive whisperings, even if abundant, do not invalidate the prayer. The general purport of the Prophet’s saying, peace and blessings be upon him, also supports this: “Allah has pardoned my nation for what their souls whisper to them, so long as they do not act upon it or speak of it.” (2) This includes one who experiences abundant whisperings during his prayer.
In any case, a person should strive, as much as he is able, to keep his heart present in the prayer. There is no doubt that Satan will assail him fiercely, for he swore by the might of Allah that he would lead all people astray, except Allah’s sincere servants. Yet whenever he assails you, seek refuge in Allah from Satan, the accursed, as the Prophet, peace and blessings be upon him, instructed. (3) Continue training yourself to maintain presence of heart in the prayer until it becomes habitual for you.