The Funeral Prayer (Salat Al-Janazah)
Man Lā Yaḥḍuruh al-Faqīh|Volume 1|Book 1|Chapter 26
وَ كَانَ عَلِيٌّ عَلَيْهِ اَلسَّلاَمُ إِذَا صَلَّى عَلَى اَلرَّجُلِ وَ اَلْمَرْأَةِ قَدَّمَ اَلْمَرْأَةَ وَ أَخَّرَ اَلرَّجُلَ وَ إِذَا صَلَّى عَلَى اَلْعَبْدِ وَ اَلْحُرِّ قَدَّمَ اَلْعَبْدَ وَ أَخَّرَ اَلْحُرَّ وَ إِذَا صَلَّى عَلَى اَلْكَبِيرِ وَ اَلصَّغِيرِ قَدَّمَ اَلصَّغِيرَ وَ أَخَّرَ اَلْكَبِيرَ.
When Imam Ali ibn Abi Talib عليه السلام performed the funeral prayer for a man and a woman together, he would place the woman in front and the man behind. When praying for a slave and a free person, he would place the slave in front and the free person behind. When praying for an elder and a child, he would place the child in front and the elder behind.
- Ṣaḥīḥ al-Faqīh, p. 31