Abu Ghalib reported,

I prayed with Anas bin Malik over the funeral of a man, and he stood level with the man's head. Then they brought the funeral of a woman from Quraysh and said, "Abu Hamza, pray over her."He stood level with the middle of the bier.Ala bin Ziyad asked him, "Is this how you saw the Messenger of Allah ﷺ stand in relation to the woman, just as you stood, and in relation to the man, just as you stood?"He replied, "Yes."When he finished, he said, "Remember this."

Azami 3687

Sahih

عن أبي غالب قال

صليت مع أنس بن مالك على جنازة رجل، فقام حيال رأسه، ثم جاءوا بجنازة امرأة من قريش فقالوا: يا أبا حمزة! صل عليها، فقام حيال وسط السرير، فقال له العلاء بن زياد: هكذا رأيت رسول الله ﷺ قام على الجنازة مقامك منها، ومن الرجل مقامك منه؟ قال: نعم، فلما فرغ قال: احفظوا.

الأعظمي 3687صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Prayer over the deceased
Section
Imam stands at the middle of the bier for a woman and at the head for a man
Numbering
Jami al-Kamil 3687 (2nd edition)
Azami 3687