It is narrated from Sayyiduna Mughirah bin Shu'bah (may Allah be pleased with him) that he narrated this hadith as marfu' (attributed) from the Prophet (peace and blessings be upon him), that he (peace and blessings be upon him) said: "The rider walks behind the funeral, and the one on foot walks behind it, in front of it, and to its right and left, close to it; and the funeral prayer is offered over a miscarried child, and supplication is made for its parents for forgiveness and mercy."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6779