It is narrated from Sayyiduna Mughirah bin Shu'bah (may Allah be pleased with him) - and (the narrator) said: I think the family of Ziyad told me that he narrated it as a statement of the Prophet (peace and blessings be upon him) (marfu') - that: "The rider walks behind the funeral bier, and the one on foot may walk behind it, on its right and on its left; and the funeral prayer is offered for the miscarried child (who dies at birth), and supplication is made for his parents for forgiveness and mercy."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 18166