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 he might shroud his father in it. The Prophet gave it to him. Then he asked him to pray over his father, 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 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. 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."Still, the Messenger of Allah ﷺ prayed over him, and Allah revealed, "And never pray over any of them who has died, nor stand at his grave" [Tawbah 9:84].This carries the same meaning as the hadith of Abu Usama, with the addition, "So he stopped praying over them."
و حدثناه محمد بن المثنى وعبيد الله بن سعيد قالا حدثنا يحيى وهو القطان عن عبيد الله بهذا الإسناد في معنى حديث أبي أسامة وزاد قال فترك الصلاة عليهم