Sunan an-Nasa'i, Volume 3, Book 21, Hadith 1979 (DarusSalam)

It was narrated that 'Ammar said: "The Janazah of a boy and a woman were brought. The boy was placed closer to the people and the woman was placed beyond him, and the funeral prayer was offered for them. Among the people were Abu Saeed Al-Khudri, Ibn Abbas, Abu Qatadah and Abu Hurairah. I asked them about that and they said: '(It is) Sunnah."'

أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ يَزِيدَ، قَالَ حَدَّثَنَا أَبِي قَالَ، حَدَّثَنَا سَعِيدٌ، قَالَ حَدَّثَنِي يَزِيدُ بْنُ أَبِي حَبِيبٍ، عَنْ عَطَاءِ بْنِ أَبِي رَبَاحٍ، عَنْ عَمَّارٍ، قَالَ حَضَرَتْ جَنَازَةُ صَبِيٍّ وَامْرَأَةٍ فَقُدِّمَ الصَّبِيُّ مِمَّا يَلِي الْقَوْمَ وَوُضِعَتِ الْمَرْأَةُ وَرَاءَهُ فَصَلَّى عَلَيْهِمَا وَفِي الْقَوْمِ أَبُو سَعِيدٍ الْخُدْرِيُّ وَابْنُ عَبَّاسٍ وَأَبُو قَتَادَةَ وَأَبُو هُرَيْرَةَ فَسَأَلْتُهُمْ عَنْ ذَلِكَ فَقَالُوا السُّنَّةُ ‏.‏

sunnah.com