Abdullah bin Ubayy's father said to him, "My son, ask for one of the garments of the Prophet ﷺ so that I may be shrouded in it, and ask him to pray over me."So he went to him and said, "Messenger of Allah, you know the standing of Abdullah. He asks you for one of your garments to be shrouded in, and that you pray over him."Umar said, "Messenger of Allah, will you pray over him when Allah has forbidden you to pray over him?"The Prophet asked, "Where?"Umar recited, "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" [Tawbah 9:80].The Prophet said, "Then I shall go beyond seventy."So Allah revealed, "And never pray over any one of them who dies, nor stand at his grave" [Tawbah 9:84].Then he sent for Umar and told him of this.
أن عبد الله بن أبي قال له أبوه: أي بني! اطلب ثوبا من ثياب النبي ﷺ تكفني فيه، ومره فليصل علي، قال: فأتاه فقال: يا رسول الله! قد عرفت شرف عبد الله، وهو يطلب إليك ثوبا من ثيابك تكفنه فيه، وتصلي عليه، فقال عمر: يا رسول الله! أتصلي عليه، وقد نهاك الله أن تصلي عليه؟ فقال: أين؟ فقال: {استغفر لهم أو لا تستغفر لهم إن تستغفر لهم سبعين مرة فلن يغفر الله لهم} [سورة التوبة: ٨٠] قال: فإني سأزيد على سبعين، فأنزل الله: {ولا تصل على أحد منهم مات أبدا ولا تقم على قبره} [سورة التوبة: ٨٤] قال: فأرسل إلى عمر فأخبره بذلك.
Bayhaqi narrated it in Dalail (5/288) from Bishr bin Sari, [who said], "Rabah bin Abu Maruf al-Makki narrated to us, [saying], 'Salim bin Ajlan narrated to us, from Saeed bin Jubayr, from Ibn Abbas,'" and he related it.Its narrators are the men of the sahih collections, except that there is some discussion regarding Rabah bin Abu Maruf and his teacher Salim bin Ajlan, though the hadith has nonetheless been graded hasan. Bayhaqi did not give the rest of the chain leading up to Bishr bin Sari. And Allah knows best.