At-Taubah - 9:84

وَلاَ تُصَلِّ عَلَى أَحَدٍ مِّنْهُم مَّاتَ أَبَدًا وَلاَ تَقُمْ عَلَىَ قَبْرِهِ إِنَّهُمْ كَفَرُواْ بِاللّهِ وَرَسُولِهِ وَمَاتُواْ وَهُمْ فَاسِقُونَ
[9:84]
And never offer prayer for any one of them who dies and do not stand by his grave; surely they disbelieve in Allah and His Messenger and they shall die in transgression.
Nor do thou ever pray for any of them that dies, nor stand at his grave; for they rejected Allah and His Messenger, and died in a state of perverse rebellion.
And never (O Muhammad) pray for one of them who dieth, nor stand by his grave. Lo! they disbelieved in Allah and His messenger, and they died while they were evil-doers.