9:84
وَلَا تُصَلِّ عَلَىٰٓ أَحَدٍۢ مِّنْهُم مَّاتَ أَبَدًۭا وَلَا تَقُمْ عَلَىٰ قَبْرِهِۦٓ ۖ إِنَّهُمْ كَفَرُوا۟ بِٱللَّهِ وَرَسُولِهِۦ وَمَاتُوا۟ وَهُمْ فَٰسِقُونَ
And do not pray [the funeral prayer, O Muhammad], over any of them who has died - ever - or stand at his grave. Indeed, they disbelieved in Allah and His Messenger and died while they were defiantly disobedient.
Translation · Saheeh International
Tafsir
Ibn Kathīr (abridged)
The Prohibition of Prayer for the Funeral of Hypocrites
Allah commands His Messenger to disown the hypocrites, to abstain from praying the funeral prayer when any of them dies, from standing next to his grave to seek Allah's forgiveness for him, or to invoke Allah for his benefit. This is because hypocrites disbelieved in Allah and His Messenger and died as such. This ruling applies to all those who are known to be hypocrites, even though it was revealed about the specific case of `Abdullah bin Ubayy bin Salul, the chief hypocrite. Al-Bukhari recorded that Ibn `Umar said, "When `Abdullah bin Ubayy died, his son, `Abdullah bin `Abdullah, came to the Messenger of Allah ﷺ and asked him to give him his shirt to shroud his father in, and the Messenger did that. He also asked that the Prophet offer his father's funeral prayer, and Allah's Messenger ﷺ stood up to offer the funeral prayer. `Umar took hold of the Prophet's robe and said, `O Allah's Messenger! Are you going to offer his funeral prayer even though your Lord has forbidden you to do so' Allah's Messenger ﷺ said,
«إِنَّمَا خَيَّرَنِي اللهُ فَقَالَ:
(I have been given the choice, for Allah says:
اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ إِن تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً فَلَن يَغْفِرَ اللَّهُ لَهُمْ
(Whether you ask forgiveness for them (hypocrites), or do not ask for forgiveness for them. Even though you ask for their forgiveness seventy times, Allah will not forgive them.)