حَدَّثَنَا أَبُو بِشْرٍ، بَكْرُ بْنُ خَلَفٍ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، عَنْ عُبَيْدِ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ بْنُ أُبَىٍّ جَاءَ ابْنُهُ إِلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ فَقَالَ يَا رَسُولَ اللَّهِ أَعْطِنِي قَمِيصَكَ أُكَفِّنْهُ فِيهِ ‏.‏ فَقَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ ‏"‏ آذِنُونِي بِهِ ‏"‏ ‏.‏ فَلَمَّا أَرَادَ النَّبِيُّ ـ صلى الله عليه وسلم ـ أَنْ يُصَلِّيَ عَلَيْهِ قَالَ لَهُ عُمَرُ بْنُ الْخَطَّابِ مَا ذَاكَ لَكَ ‏.‏ فَصَلَّى عَلَيْهِ النَّبِيُّ ـ صلى الله عليه وسلم ـ فَقَالَ لَهُ النَّبِيُّ ـ صلى الله عليه وسلم ـ ‏"‏ أَنَا بَيْنَ خِيرَتَيْنِ ‏{اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ }‏ ‏"‏ ‏.‏ فَأَنْزَلَ اللَّهُ سُبْحَانَهُ ‏{وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا وَلاَ تَقُمْ عَلَى قَبْرِهِ}‏ ‏.‏

It wasnarrated that Ibn ‘Umar said: “When ‘Abdullah bin Ubayy died,his son came to the Prophet (PBUH) and said: ‘O Messenger of Allah,give me your shirt so that I may shroud him in it.’ The MessengerofAllah (PBUH) said: ‘Notify me when he is ready (i.e., when he hasbeenwashed and shrouded).’ When the Prophet (PBUH) wanted to offerthefuneral prayer for him: ‘You should not do that.’ The Prophet(aw)offered the funeral prayer for him, and the Prophet (PBUH) saidto him:‘I have been given two choices: “...ask forgiveness forthem(hypocrites) or ask not forgiveness for them...’” [9:80]Then Allahrevealed: ‘And never pray (the funeral prayer) for anyof them(hypocrites) who dies, nor stand at his grave.’” [9:84] Translation Not Available

Book Ref: Sunan Ibn Majah Book 6 Hadith 1523
Web Ref:  Sunan Ibn Majah Vol 1 Book 6 Hadith 1523