When Abdullah bin Ubayy died, his son came to the Messenger of Allah ﷺ and said, "Messenger of Allah, give me your shirt so I may shroud him in it, pray over him, and seek forgiveness for him."So he gave him his shirt and said, "When you have finished preparing him, let me know."When he had finished, he informed him, and the Prophet came to pray over him. Umar pulled him back and said, "Has Allah not forbidden you to pray over the hypocrites?"He replied, "Whether you seek forgiveness for them or do not seek forgiveness for them, even if you seek forgiveness for them seventy times, Allah will never forgive them" [Tawbah 9:80].Then was revealed "And never pray over any of them who has died, nor stand at his grave" [Tawbah 9:84], and he ceased praying over them.
حدثنا صدقة أخبرنا يحيى بن سعيد عن عبيد الله قال أخبرني نافع
لما توفي عبد الله بن أبي جاء ابنه إلى رسول الله ﷺ فقال يا رسول الله أعطني قميصك أكفنه فيه وصل عليه واستغفر له فأعطاه قميصه وقال إذا فرغت منه فآذنا فلما فرغ آذنه به فجاء ليصلي عليه فجذبه عمر فقال أليس قد نهاك الله أن تصلي على المنافقين فقال {استغفر لهم أو لا تستغفر لهم إن تستغفر لهم سبعين مرة فلن يغفر الله لهم} فنزلت {ولا تصل على أحد منهم مات أبدا ولا تقم على قبره} فترك الصلاة عليهم