وَلَا تُصَلِّ عَلَىٰٓ أَحَدٍۢ مِّنْهُم مَّاتَ أَبَدًۭا وَلَا تَقُمْ عَلَىٰ قَبْرِهِۦٓ ۖ إِنَّهُمْ كَفَرُوا۟ بِٱللَّهِ وَرَسُولِهِۦ وَمَاتُوا۟ وَهُمْ فَـٰسِقُونَ
“And do not ever offer [funeral] prayers for any of their dead, nor stand by their grave [at burial], for they have lost faith in Allah and His Messenger and died rebellious”
Revealed after the Prophet ﷺ prayed janazah for Abdullah ibn Ubayy.