A man came to Messenger of Allah ﷺ and said, "O Messenger of Allah ﷺ! 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 Messenger of Allah ﷺ 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. (Using translation from Bukhārī 4746)
أَنَّ رَجُلًا أَتَى رَسُولَ اللهِ ﷺ فَقَالَ يَا رَسُولَ اللهِ أَرَأَيْتَ رَجُلًا رَأَى مَعَ امْرَأَتِهِ رَجُلًا أَيَقْتُلُهُ فَتَقْتُلُونَهُ أَمْ كَيْفَ يَفْعَلُ بِهِ؟ فَأَنْزَلَ اللهُ فِيهَا مَا ذَكَرَ فِي الْقُرْآنِ مِنَ الْمُتَلَاعِنَيْنِ فَقَالَ لَهُ رَسُولُ اللهِ ﷺ قَدْ قُضِيَ فِيكَ وَفِي امْرَأَتِكَ قَالَ فَتَلَاعَنَا وَأَنَا شَاهِدٌ عِنْدَ رَسُولِ اللهِ ﷺ فَقَالَ يَا رَسُولَ اللهِ إِنْ أَمْسَكْتُهَا فَقَدْ كَذَبْتُ عَلَيْهَا فَفَارَقَهَا فَجَرَتِ السُّنَّةُ بَعْدُ فِيهِمَا أَنْ يُفَرَّقَ بَيْنَ الْمُتَلَاعِنَيْنِ وَكَانَتْ حَامِلًا فَأَنْكَرَ حَمْلَهَا فَكَانَ ابْنُهَا يُدْعَى إِلَيْهَا ثُمَّ جَرَتِ السُّنَّةُ بَعْدُ فِي الْمِيرَاثِ أَنْ يَرِثَهَا وَتَرِثُ مِنْهُ مَا فَرَضَ اللهُ ﷻ لَهَا