(59) باب صَلاَةِ الصِّبْيَانِ مَعَ النَّاسِ عَلَى الْجَنَائِزِ
Narrated 'Amir:
Ibn `Abbas (who was at that time a boy) said, "Allah's Messenger (ﷺ) 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."
Reference: Sahih al-Bukhari 1326
In-book reference: Book 23, Hadith 83
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 2, Book 23, Hadith 411