Ja'far narrates from his father that Sayyiduna Ali (may Allah be pleased with him) used to say: Whatever makes the prescribed punishment (hadd) obligatory also makes ghusl obligatory.