Islam legislated the law of 'Li‘ān' (invoking the curse of Allah upon the liar among the two spouses for falsehood in the matter of witnessing adultery) as a solution to the problem of a husband witnessing another man committing adultery with his wife without four other witnesses (or visa versa). The husband cannot just be in suspicion about the matter: he must clearly witness the actual act of penetration of the adultery. The punishment for any false accusation and lying in this matter is extremely grievous (torment in Hellfire). The man in this story was feeling doubtful about the conduct of his wife and was worried that she might commit adultery. He was confused about what to do, for if he accused her (without the four witnesses) then he would undergo the relevant legal punishment (of whipping, etc), and if he remained silent about it then he would be considered a cuckold and suffer disgrace. He went to the Prophet (may Allah's peace and blessings be upon him) and mentioned these things to him. The Prophet (may Allah's peace and blessings be upon him) remained silent as he did not like to answer questions about issues which had not yet occurred, because this leads to evil and could possibly open the doors for evil to occur. In addition to that no verses were yet revealed to the Prophet (may Allah's peace and blessings be upon him) regarding this issue. After some time the same man who questioned the Prophet (may Allah's peace and blessings be upon him) saw the monstrosity (adultery) he had asked about previously and about which he had worries. Thereupon Allah revealed some rulings regarding this issue in Sūrat An-Nūr, as He says (what means) {Those who accuse their wives} [Qur'an 24:6]. The Prophet (may Allah's peace and blessings be upon him) recited these verses to the man, admonished him and reminded him that if he was lying in accusing his wife, then the worldly punishment of false accusations is less severe than the punishment of the Hereafter. The man swore the sacred oath by Allah that he was not lying about witnessing and accusing his wife of adultery. Then the Prophet (may Allah's peace and blessings be upon him) called the wife and admonished her and told her that the punishment of this life is less severe than the punishment of the Hereafter. Then she swore also that her husband was a liar. Then, the Prophet may Allah's peace and blessings be upon him, started by the one with whom Allah has started with (i.e. in the Qur'anic verses mentioned above), the husband. The man testified four times by Allah that he was truthful in what he accused his wife with, and upon the fifth time he invoked the curse of Allah upon himself if he was a liar. Then the Prophet (may Allah's peace and blessings be upon him) summoned his wife, and she testifies four times by Allah that her husband was a liar, and she also upon the fifth time invoked the anger of Allah upon herself if her husband was truthful. Then the Prophet (may Allah's peace and blessings be upon him) separated between them permanently (and irrevocably). Given that one of them was definitely a liar, the Prophet (may Allah's peace and blessings be upon him) urged them to repent. Then the husband requested his dowry back and the Prophet (may Allah's peace and blessings be upon him) said: "you have no right to claim the dowry: if you were truthful about her committing adultery then the dowry you gave her was in exchange for your sexual relations with her during your marriage. And if you were lying about her, then it is even less rightful that you would receive anything because you accused her of such a terrible lie and great falsehood.