Al-Kāfi - Volume 3 > Reason behind Washing a Dead Body for Burial and After Sexual Activities
Hadith #2

2ـ عَلِيُّ بْنُ إِبْرَاهِيمَ عَنْ أَبِيهِ عَنِ النَّوْفَلِيِّ عَنِ السَّكُونِيِّ عَنْ أَبِي عَبْدِ الله (عَلَيْهِ الْسَّلام) قَالَ سُئِلَ مَا بَالُ الْمَيِّتِ يُمْنِي قَالَ النُّطْفَةُ الَّتِي خُلِقَ مِنْهَا يَرْمِي بِهَا.

2. Ali ibn Ibrahim has narrated from his father from al-Nawfaliy, from al-Sakuniy who has said the following: “Once, a person asked abu ‘Abd Allah, ‘Alayhi al-Salam, ‘Why does a dying person discharge (semen)?’ He said, ‘It is the seed from which he is created that he throws out.’”