When Abdullah bin Ubayy bin Salul died, his son Abdullah bin Abdullah came to the Messenger of Allah ﷺ and asked him for his shirt so that his father might be shrouded in it, and he gave it to him. Then he asked him to pray over him, so the Messenger of Allah ﷺ stood up to pray over him.Umar rose and took hold of the garment of the Messenger of Allah ﷺ and said, "Messenger of Allah, are you praying over him when Allah 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' [Tawba 9:80]. And I will exceed seventy."Umar said, "But he is a hypocrite."Still, the Messenger of Allah ﷺ prayed over him, and Allah then revealed, "And never pray over any of them who has died, nor stand at his grave" [Tawba 9:84].
لما توفي عبد الله بن أبي ابن سلول جاء ابنه عبد الله بن عبد الله إلى رسول الله ﷺ، فسأله أن يعطيه قميصه أن يكفن فيه أباه، فأعطاه، ثم سأله أن يصلي عليه، فقام رسول الله ﷺ ليصلي عليه، فقام عمر فأخذ بثوب رسول الله ﷺ، فقال: يا رسول الله، أتصلي عليه، وقد نهاك الله أن تصلي عليه؟ فقال رسول الله ﷺ: إنما خيرني الله، فقال: {استغفر لهم أو لا تستغفر لهم إن تستغفر لهم سبعين مرة} [التوبة: ٨٠] الآية، و سأزيده على سبعين. قال: إنه منافق، فصلى عليه رسول الله ﷺ، وأنزل الله عز وجل: {ولا تصل على أحد منهم مات أبدا ولا تقم على قبره}[التوبة: ٨٤].
Bukhari narrated it in the tafsir (4670), and Muslim in the virtues of the companions (2400), both of them through Abu Usama, who said, Ubaydullah narrated to us, from Nafi, from Ibn Umar, who mentioned it.