Narrated Sahl bin Sad:
A man came to Allah's Apostle and said, "O Allah's Apostle! Suppose a man saw another man with his wife, should he kill him whereupon you might kill him (i.e. the killer) (in Qisas) or what should he do?" So Allah revealed concerning their case what is mentioned of the order of Mula'ana. Allah's Apostle ﷺ said to the man, "The matter between you and your wife has been decided." So they did Mula'ana in the presence of Allah's Apostle and I was present there, and then the man divorced his wife. So it became a tradition to dissolve the marriage of those spouses who were involved in a case of Mula'ana. The woman was pregnant and the husband denied that he was the cause of her pregnancy, so the son was (later) ascribed to her. Then it became a tradition that such a son would be the heir of his mother, and she would inherit of him what Allah prescribed for her.
Sahih al-Bukhari, Vol. 6, Book of Prophetic Commentary on the Qur'an, Hadith 270
Sahih al-Bukhari, Book of Prophetic Commentary on the Qur'an, Hadith 270