Surah At-Tawbah 9:84
وَلَا تُصَلِّ عَلَىٰٓ أَحَدٍ مِّنْهُم مَّاتَ أَبَدًا وَلَا تَقُمْ عَلَىٰ قَبْرِهِۦٓ ۖ إِنَّهُمْ كَفَرُوا۟ بِٱللَّهِ وَرَسُولِهِۦ وَمَاتُوا۟ وَهُمْ فَـٰسِقُونَ
And do not pray [the funeral prayer, O Muḥammad], over any of them who has died - ever - or stand at his grave. Indeed, they disbelieved in Allāh and His Messenger and died while they were defiantly disobedient.
Translation: Saheeh International
Tafsir
When the Prophet s prayed over the dead body of ‘Abd Allāh Ibn Ubayy the following was revealed And never pray over any one of them when he is dead nor stand over his grave at a burial or as a visit; lo! they disbelieved in God and His Messenger and died while they were wicked they died disbelieving.
Excerpt from Tafsir al-Jalalayn, commentary on 9:84, via Quran.com. The reader has the full commentary and 9 more tafsirs.