Abdullah bin Umar reported,

When Abdullah died, his son Abdullah bin Abdullah came to the Messenger of Allah ﷺ and asked him for his shirt so that he might shroud his father in it, and he gave it to him. Then he asked him to pray over him, and the Messenger of Allah ﷺ rose to pray.Umar stood up and took hold of the Messenger of Allah's garment and said, "Messenger of Allah, are you going to pray over him when your Lord has forbidden you to pray over him?"The Messenger of Allah ﷺ replied, "Allah has only given me a choice. He said, '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, because they disbelieved in Allah and His Messenger, and Allah does not guide the rebellious people' [Tawbah 9:80]. And I will add more than seventy."Umar said, "But he is a hypocrite."The narrator continued, So the Messenger of Allah ﷺ prayed over him, and Allah revealed, "And never pray over any of them who dies, nor stand at his grave" [Surah Tawbah 9:84].

Azami 12501

Sahih

عن ابن عمر قال

لما توفي عبد الله، جاء ابنه عبد الله بن عبد الله إلى رسول الله ﷺ فسأله أن يعطيه قميصه يكفن فيه أباه، فأعطاه، ثم سأله أن يصلي عليه، فقام رسول الله ﷺ ليصلي، فقام عمر، فأخذ بثوب رسول الله ﷺ: فقال: يا رسول الله! تصلي عليه وقد نهاك ربك أن تصلي عليه؟ فقال رسول الله ﷺ: إنما خيرني الله، فقال: {استغفر لهم أو لا تستغفر لهم إن تستغفر لهم سبعين مرة فلن يغفر الله لهم ذلك بأنهم كفروا بالله ورسوله والله لا يهدى القوم الفاسقين} وسأزيده على السبعين. قال: إنه منافق. قال: فصلى عليه رسول الله ﷺ فأنزل الله {ولا تصل على أحد منهم مات أبدا ولا تقم على قبره} [سورة التوبة: ٨٤].

الأعظمي 12501صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "Ask forgiveness for them or do not ask forgiveness for them. If you ask forgiveness for them seventy times, Allah will never forgive them. That is because they disbelieved in Allah and His Messenger, and Allah does not guide the people"
Numbering
Jami al-Kamil 12501 (2nd edition)
Azami 12501