It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that when Abdullah bin Ubayy bin Salul died, his son Abdullah bin Abdullah came to the Messenger of Allah (peace and blessings be upon him) and asked him: Give me your shirt so that I may shroud my father in it. So he (peace and blessings be upon him) gave it to him. Then he asked him: Please lead his funeral prayer. So the Messenger of Allah (peace and blessings be upon him) stood up to lead the funeral prayer, whereupon Sayyiduna Umar (may Allah be pleased with him) took hold of the shirt of him (peace and blessings be upon him) and said: O Messenger of Allah! Will you lead his funeral prayer when Allah Almighty has forbidden you? He (peace and blessings be upon him) said: "Rather, Allah Almighty has given me a choice," and he recited this verse: "Ask forgiveness for them or do not ask forgiveness for them; even if you ask forgiveness for them seventy times, Allah will never forgive them" [Surah al-Tawbah: 80], meaning: whether you seek forgiveness for them or not, even if you seek forgiveness seventy times, Allah Almighty will still not forgive them; "and perhaps I will do it more than seventy times." Sayyiduna Umar (may Allah be pleased with him) said: He is a hypocrite. He said: Then the Messenger of Allah (peace and blessings be upon him) led his funeral prayer, and Allah Almighty revealed this blessed verse: "And do not ever pray over any of them who dies, nor stand at his grave" [Surah al-Tawbah: 84], meaning: from now on you shall not pray the funeral prayer over any of them, nor ever stand at their grave.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6688