It was narrated from Yazid bin Thabit that: they went out with the Messenger of Allah one day and he saw a new grave. He said: What is this? They said: This is so-and-so, the freed slave woman of Banu so-and-so - whom Messenger of Allah knew - She died at midday and we did not like to wake you up when you were fasting and taking a nap. The Messenger of Allah stood (for prayer) and the people formed rows behind him. He said four Takbirs over her then he said: If anyone among you dies while I am still among you, inform me, for my prayer for his is a mercy.
It was narrated from Sulaiman Ash-Shaibani from Ash-Sha'bi: Some people passed by an isolated grave with the Messenger of Allah and he led them in prayer and they formed rows behind him. I said: Who was that O Abu 'Amr? He said: Ibn 'Abbas.
Ash-Shaibani narrated that Ash-Sha'bi said: Someone who saw the Prophet pass by an isolated grave told me that he offered the funeral prayer there and his Companions formed rows behind him. It was said: Who told you this? He said: Ibn 'Abbas.
It was narrated from Jabir: That the Prophet prayed at the grave of a woman after she had been buried.