Once, Satan approached Prophet Musa (a.s) and said to him: “You are the Prophet of Allah while I am one of His sinning and disobedient creations. It is my desire that I repent before Him, so request Him to accept my repentance.”
Musa (a.s) agreed and prayed for him, whereupon Allah said: “O’ Musa! I shall accept your intercession for him. Tell him to prostrate upon Adam’s grave in order that I accept his repentance.” Musa (a.s) met Satan and said: “Prostrating upon Adam’s grave shall cause your repentance to be accepted.”
Hearing this, Satan said: “I did not prostrate before Adam when he was alive, how can I prostrate upon his grave now that he is dead? I shall never do such a thing!” Then continuing, he said: “O’ Musa! Since you interceded for me before Allah you have obliged me. I shall advise you to be wary of me in three places in order that you do not face damnation and ruin. First: During anger; for in that state my soul is in your heart and my eyes into yours. Second: During a battle (jihad); for in that state I cause the soldiers to bring their wives, children and relatives to mind in order that they turn back from the battle and flee away. Third: Never sit with a non-mahram woman in one place for I shall whisper temptations into both of you.” ( Shanidaniha-e-Tarikh, pg. 258; Mahajjatul Baidha, vol. 5, pg. 59 )