All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The Prophet was washed (when he died) without undressing him. The Companions who washed him were: Al-‘Abbaas, ‘Ali, Al-Fadhl ibn Al-'Abbaas, Qutham ibn Al-‘Abbaas, Shuqraan – who was the freed slave of the Prophet – Usaamah ibn Zayd, and 'Aws ibn Khawlah .
Al-‘Abbaas, Al-Fadhl and Qutham turned him (from side to side), and Usaamah and Shuqraan poured water on him, and ‘Ali washed him and 'Aws held him to his chest.
Then they enshrouded him in three pieces of white Sahooli (made in Sahool, a town in Yemen) sheets of cloth made of cotton without a shirt or a turban, and they wrapped him in them (the three white sheets of cloth).
Then people prayed the funeral prayer for him individually without any person leading the prayer. The scholars said that this is due to the greatness of the Prophet and because the Companions were keen on not letting anyone lead the prayer for him, rather, each person would perform the funeral prayer for him directly. They also wanted to let Muslims perform the funeral prayer for him individually – men, women, children and even male and female slaves, and to enable the people who lived around Madeenah to catch up (arrive on time for the funeral prayer).
Moreover, Al-Bazzaar and Al-Haakim reported in a weak narration that the Prophet recommended that no person should lead the funeral prayer for him.
Thus, the Companions performed the funeral prayer for him in groups. A group of people would enter the mosque and perform the funeral prayer for him individually, and then another group would enter and do the same.
After men, women and children performed the funeral prayer for him, he was buried in his room where he died.
This method of the funeral prayer for the Prophet was reported by the most important books of Seerah (biography of the Prophet ) and was generally mentioned in Al-Bukhari and Muslim.
Allaah Knows best.