Allah's Messenger, are you going to offer prayer, whereas Allah has forbidden to offer prayer for him, whereupon Allah's Messenger (ﷺ) said: Allah has given me a choice saying: Ask forgiveness for them or you may not ask for them; even if you ask for them seventy times, I will make an addition to the seventy. He was a hypocrite and Allah's Messenger (ﷺ) said prayer over him that Allah, the Exalted and Glorious, revealed the verse:" And never pray over any one of them that has died and never should you stand by his grave" (ix. 84).
Sahih Muslim Book 44, Hadith 37