Sunan Ibn Majah, Volume 2, Book 6, Hadith 1490 (DarusSalam) ⓘ
Malik bin Hubairah Ash-Shami, who was a Companion of the Prophet, said: “If a funeral procession was brought and the number of people who followed it was considered to be small, they would be organized into three rows, then the funeral prayer would be offered.” He said: “The Messenger of Allah said: ‘No three rows of Muslims offer the funeral prayer for one who has died, but he will be guaranteed (Paradise).’”
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَعَلِيُّ بْنُ مُحَمَّدٍ، قَالاَ حَدَّثَنَا عَبْدُ اللَّهِ بْنُ نُمَيْرٍ، عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ، عَنْ يَزِيدَ بْنِ أَبِي حَبِيبٍ، عَنْ مَرْثَدِ بْنِ عَبْدِ اللَّهِ الْيَزَنِيِّ، عَنْ مَالِكِ بْنِ هُبَيْرَةَ الشَّامِيِّ، - وَكَانَتْ لَهُ صُحْبَةٌ - قَالَ كَانَ إِذَا أُتِيَ بِجِنَازَةٍ فَتَقَالَّ مَنْ تَبِعَهَا جَزَّأَهُمْ ثَلاَثَةَ صُفُوفٍ ثُمَّ صَلَّى عَلَيْهَا وَقَالَ إِنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ " مَا صَفَّ صُفُوفٌ ثَلاَثَةٌ مِنَ الْمُسْلِمِينَ عَلَى مَيِّتٍ إِلاَّ أَوْجَبَ " .
also referenced under: Hadith 1490 (Reference) & Book 6, Hadith 1557 (In-Book)