Al-Kāfi

Hadith 677
funeral-prayer
4ـ عَلِيُّ بْنُ إِبْرَاهِيمَ عَنْ أَبِيهِ عَنْ مُحَمَّدِ بْنِ يَحْيَى عَنْ طَلْحَةَ بْنِ زَيْدٍ عَنْ أَبِي عَبْدِ الله (عَلَيْهِ الْسَّلام) قَالَ إِذَا حَضَرَ الإِمَامُ الْجِنَازَةَ فَهُوَ أَحَقُّ النَّاسِ بِالصَّلاَةِ عَلَيْهَا.
4. Ali ibn Ibrahim has narrated from his father from Muhammad ibn Yahya from Talhah ibn Zayd who has said the following: “Abu ‘Abd Allah (a.s.), has said, ‘If the Imam is present, he is the most deserving of all people to perform Salah (prayer) for a deceased person.’”
Source: Shaykh Muḥammad b. Yaʿqūb al-Kulaynī