Ibn ʿAbbas (who was at that time a boy) said, "Messenger of Allah ﷺ came to a grave and the people said, 'He or she was buried yesterday.' " Ibn ʿAbbas added, "We aligned behind the Prophet ﷺ and he led the funeral prayer of the deceased."
أَتَى رَسُولُ اللَّهِ ﷺ قَبْرًا فَقَالُوا هَذَا دُفِنَ أَوْ دُفِنَتِ الْبَارِحَةَ قَالَ ابْنُ عَبَّاسٍ ؓ فَصَفَّنَا خَلْفَهُ ثُمَّ صَلَّى عَلَيْهَا