It is narrated from Miqdad bin Aswad (may Allah be pleased with him) that Ali bin Abi Talib (may Allah be pleased with him) told him to ask the Messenger of Allah (peace and blessings be upon him) about a man who approaches his wife and pre-seminal fluid (madhiy) is discharged—what should he do? Ali (may Allah be pleased with him) said: The daughter of the Messenger of Allah (peace and blessings be upon him) is (married) to me, and I feel shy to ask. Miqdad (may Allah be pleased with him) says: I asked the Messenger of Allah (peace and blessings be upon him) about this, and he said: "When any of you experiences this, he should wash his private part and perform ablution as he does for prayer."
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 62
Hadith Takhrijأخرجه مسلم: الحيض، باب المذي: 303 وأبوداؤد، الطهارة، باب في المذي: 207.