Ruling on one    spouse washing the other when he or she has died
Question

A man died, and his wife gave birth a few hours later. Is it permissible for her to wash his body?
Praise be to Allah.We put this question to Shaykh Muhammad ibn Saalih al-‘Uthaymeen, may Allah preserve him, who answered:
“No, because when she gave birth, the relationship between her and her husband came to an end. It is not permissible for her to wash him because now she is no longer his wife, and thus if she were to enter into a (new) marriage contact at this time, it would be valid.”
When a woman’s husband dies, she should observe the ‘iddah (waiting period or mourning period) of four months and ten days. If she is pregnant, her ‘iddah lasts until she gives birth. Once her ‘iddah is over or she has given birth, there is no longer any connection between them. It is permissible for a wife to wash her husband’s body, and vice versa, if this is still within the ‘iddah period, because the connection between husband and wife does not end merely because of death. The evidence for this from the Sunnah of the Prophet (peace and blessings of Allah be upon him) is the hadeeth of ‘Aa’ishah (may Allah be pleased with her), who said: “The Messenger of Allah (peace and blessings of Allah be upon him) came back from (the cemetery of) al-Baqee’ and found me suffering a headache, saying ‘Oh, my head!’ He said, ‘No, O ‘Aa’ishah, it is I who should be saying, “Oh, my head!”’ Then he said, ‘What’s the matter? If you die before me, I will take care of you: I will wash your body, wrap you in your shroud, pray for you and bury you.’”
(Reported by Ibn Maajah, 1454; classed as saheeh by al-Albani in Ahkam al-Janaa’iz, page 50). It was reported that ‘Aa’ishah said, concerning the death of the Prophet (peace and blessings of Allah be upon him), “If I could go back and do things all over again, no one would wash him but his wives.” (Reported by Abu Dawood, 3733. Al-Albani classed its isnaad as saheeh in Ahkaam al-Janaa’iz, p. 49).
And Allah knows best.