"I heard 'Umar bin Al-Khattab saying: 'When 'Abdullah bin Ubayy died, the Messenger of Allah (ﷺ) was called to perform the funeral prayer over him. The Messenger of Allah (ﷺ) came to him, and when he stood over him, about to perform the prayer, he turned until he was standing at his chest. I said: "O Messenger of Allah! (You pray) for Allah's enemy 'Abdullah bin Ubayy, who on this day said this and that" - mentioning different days. He said: "The Messenger of Allah (ﷺ) was smiling until I had said too much to him and he said: 'Leave me O 'Umar! Indeed I have been given the choice, so I chose. I was told: Whether you ask forgiveness for them, or do not ask for forgiveness for them. Even though you ask for their forgiveness seventy times, Allah will not forgive them (9:80). If I knew that were I to ask more than seventy times that he would be forgiven, then I would do so." He said: "Then he performed the Salat for him and walked with him (his funeral procession) and he stood at his grave until it was finished. I was amazed at myself and my daring to talk like that to the Messenger of Allah (ﷺ), while Allah and His Messenger (ﷺ) know better. But by Allah! It was not long until these two Ayat were revealed: 'And never pray for any of them who dies nor stand at his grave... (9:84) until the end of the Ayah. He said: "So afterwards the Messenger of Allah (ﷺ) did not perform the Salat for a hypocrite, nor would he stand at his grave until Allah took him."
Jami` at-Tirmidhi Book 47, Hadith 149
The Messenger of Allah (ﷺ) led us in one of the evening (‘Asha) prayers, noon or afternoon. He led us in two Rak’ahs and gave the salutation. He then got up going towards a piece of wood which was placed in the front part of the mosque. He placed his hands upon it, one on the other, looking from his face as if he were angry. The people came out hastily saying: the prayer has been shortened. Abu Bakr and ‘Umar were among the people, but they were too afraid to speak to him. A man whom the Messenger of Allah (ﷺ) would call “ the possessor of arms” (Dhu al-Yadain) stood up (asking him): Have you forgotten. The Messenger of Allah, or has the prayer been shortened? He said: I have neither forgotten nor has it been shortened. He said : Messenger of Allah , you have forgotten. The Messenger of Allah (ﷺ) turned towards the people and asked : did the possessor of arms speak the truth? They made a sign , that is, yes. The Messenger of Allah (ﷺ) returned to his place and prayed the remaining two Rak’ahs, then gave the salutation; he then uttered the takbir and prostrated himself as usual or prolonged. He then raised his head and uttered the takbir; then he uttered the takbir and made prostration as usual or made longer (prostration). Then he raised his head his and uttered the takbir (Allah is most great). The narrator Muhammad was asked : Did he give the salutation (while prostrating) dueto forgetfulness? He said : I do not remember it from Abu Hurairah. But we Are sure that ‘Imran b. Husain (in his version) said; he then gave the salutation.
Sunan Abi Dawud Book 2, Hadith 619