Hadithcore
Mishkat al-Masabih, 1670, 1671

Abu Huraira reported God’s messenger as saying, “He who follows a bier and carries it three times has accomplished what is ’due to it from him." Tirmidhi transmitted it, saying that this is a <i>gharib</i> tradition. In <i>Sharh as-sunna</i> it is reported that the Prophet (ﷺ) carried the bier of Sa‘d b. Mu'adh between the two poles.

وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ:

من تبع جَنَازَة وحلمها ثَلَاثَ مَرَّاتٍ: فَقَدْ قَضَى مَا عَلَيْهِ مِنْ حَقِّهَا

. رَوَاهُ التِّرْمِذِيُّ وَقَالَ: هَذَا حَدِيثٌ غَرِيبٌ وَقَدْ رَوَى فِي «شَرْحِ السُّنَّةِ» : أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ حَمَلَ جَنَازَةَ سَعْدِ ابْن معَاذ بَين العمودين

References1 variant
In-Book Reference
Book 5, Hadith 145