In this case, ghusl is not obligatory. ‘Ali reported that the Prophet, upon whom be peace, said to him, “If sperm is ejaculated, perform ghusl.” (Related by Abu Dawud).
Said Mujahid, “We were in a meeting in the mosque with the companions of Ibn ‘Abbas (Tawus, Sa’eed ibn Jubair and ‘Ikrimah). When he stood to pray, a man came in and said, ‘Is there one who can give a legal verdict?’ We said, ‘Ask your question.’ He said, ‘Whenever I urinate, a liquid always follows it.’ We asked, ‘Is it the type of liquid that gives birth to children?’ He said, ‘Yes.’ We said, ‘Then you have to perform ghusl.’ The man went away. Ibn ‘Abbas hurried to finish his prayer, after which he told ‘Ikrimah to bring the man back. He turned to us and said, ‘Is your verdict found in the Book of Allah?’ We said, ‘No.’ He asked, ‘Is it based on the sayings of the Prophet, upon whom be peace?’ We said, ‘No.’ ‘Then from what?’ We said, ‘From our opinion.’ He said, ‘That is why the Messenger of Allah said that one learned man is more difficult for Satan than a thousand worshippers.’Â The man came and faced Ibn ‘Abbas, who said to him, ‘When that happens, is it owing to any stimulation?’ He answered, ‘No.’ Ibn ‘Abbas asked, ‘Do you feel any numbness in your body?’ He answered, ‘No.’ Said Ibn ‘Abbas, ‘That is from the cold. Ablution is sufficient.”‘