This view is narrated from Alqamah, al-Aswad, Suwayd bin Ghafalah, Ata, Tawus, Mujahid, Salim, al-Qasim and al-Hasan al-Basri (may Allah have mercy on them); they said: "The imam (ruler) will step forward (to lead the funeral prayer)."
It is also narrated from Sayyiduna Ali (peace be upon him) and Sayyiduna Jarir bin Abdullah (may Allah be pleased with him), but it is not established from either of them; however, it is well known from Sayyiduna al-Husayn bin Ali (may Allah be pleased with him).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / Q6894
Abu Hazim said: I was present on the day al-Hasan bin Ali (may Allah be pleased with him) died. I saw al-Husayn bin Ali (may Allah be pleased with him) saying to Sa'id bin al-As: "Step forward; were it not the Sunnah, you would not have been put forward." And he was jabbing him in the neck, for there was some discord between them. Then Abu Hurayrah (may Allah be pleased with him) said: "Do you begrudge the son of your Prophet a patch of earth in which you will bury him? While I heard the Messenger of Allah (peace and blessings be upon him) say: 'Whoever loves these two has loved me, and whoever hates them has hated me.'"
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6894
Isma'il bin Raja' al-Zubaydi (may Allah have mercy on him) said: I was informed by someone who was present with Sayyiduna al-Husayn bin Ali (may Allah be pleased with him) at the time Sayyiduna al-Hasan (may Allah be pleased with him) died, that he was saying to Sa'id bin al-As (may Allah be pleased with him): "Step forward; were it not the Sunnah, you would not have been put forward."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6895
Mujalid reports from al-Sha'bi (may Allah have mercy on him) that when Fatimah (may Allah be pleased with her) died, Ali (may Allah be pleased with him) buried her at night, and he took Abu Bakr al-Siddiq (may Allah be pleased with him) by the upper arms and put him forward for the funeral prayer.
This is how it was narrated with this chain, but what is correct is the following: Sayyidah Aishah (may Allah be pleased with her) states in the account of the inheritance that Fatimah (may Allah be pleased with her), the daughter of the Messenger of Allah (peace and blessings be upon him), lived for six months after him (peace and blessings be upon him). When she died, Ali (may Allah be pleased with him) buried her at night and did not inform Abu Bakr (may Allah be pleased with him), and Ali (may Allah be pleased with him) himself led the funeral prayer over her.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6896