When Abdullah bin Ubayy bin Salul died, his son Abdullah bin Abdullah bin Ubayy 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 over him. Umar stood up, 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' [Tawbah 9:80]. And I shall add more than seventy."Umar said, "But he is a hypocrite."The Messenger of Allah ﷺ prayed over him anyway, and Allah revealed, "And never pray over any of them who dies, nor stand at his grave" [Tawbah 9:84].
لما تو في عبد الله بن أبي بن سلول جاء ابنه عبد الله بن عبد الله بن أبي إلى رسول الله ﷺ وسأله أن يعطيه قميصه يكفن فيه أباه فأعطاه. ثم سأل أن يصلي عليه، فقام رسول الله ﷺ ليصلي عليه، فقام عمر فأخذ بثوب رسول الله ﷺ فقال: يا رسول الله! تصلي عليه، وقد نهاك ربك أن تصلي عليه؟ فقال رسول الله ﷺ: إنما خيرني الله فقال: {استغفر لهم أو لا تستغفر لهم إن تستغفر لهم سبعين مرة} [سورة التوبة: ٨٠] وسأزيده على سبعين قال: إنه منافق قال: فصلي عليه رسول الله ﷺ فأنزل الله: {ولا تصل على أحد منهم مات أبدا ولا تقم على قبره} [سورة التوبة: ٨٤].
Bukhari reported it in the tafsir (4670), and Muslim in the qualities of the hypocrites (2774), both from the hadith of Abu Usama, who said, our teacher Ubaydullah bin Umar related to us, from Nafi, from Ibn Umar, and he mentioned it, with the wording of both being identical. Muslim also reported it from the hadith of Qattan, from Ubaydullah, with this same chain, similarly, adding that he said, "So he stopped praying over them." In some narrations it is stated that Umar said, "I was amazed at my own boldness toward the Messenger of Allah." ﷺ