Abu Dawud Book 1, Hadith Number 337.

Chapter : A person who is sexually defiled is permitted to eat anything before washing.

Narated By Abdullah ibn Abbas : A man was injured during the lifetime of the Apostle of Allah (PBUH); he then had a sexual dream, and he was advised to wash and he washed himself. Consequently he died. When this was reported to the Apostle of Allah (PBUH) he said: They killed him; may Allah kill them! Is not inquiry the cure of ignorance?