People made a mention of washing because of sexual defilement before the Messenger of Allah (May peace be upon him). The Messenger of Allah (May peace be upon him) said: I pour (water) on my head three times. And he made a sign with both his hands.
Sunan Abi Dawud Book 1, Hadith 239