Question: Is it true that at the time of death, Devil comes to the dying person and tries to deviate him from Islam?
The fundamental pattern of behavior that the Devil chose is deviating humans from the right path:
“(Devil) said, “Because You have perverted me, I will surely sit in and wait for them on Your straight path. Then I will come to them from before them and from behind them and on their right and on their left, and You will not find most of them grateful (to You).” (al-A’raf 7:16-17)
However, according to the following verses, the Devil does not have any authority over the servants of God. Only those who themselves tend to stray can be misguided by Satan:
“(God said to Devil) Indeed, you have no authority over My servants, except for those who follow you from among the ones that are misled by fictions.” (al-Hijr 15:42)
“(God said to Devil) Indeed, you have no authority over My servants, and your Master is enough as a Trustee.” (al- Isra 17:65)
That means a believer who has lived his life according to God’s commands and prohibitions cannot be misled by Satan. That is also valid right before death.