Sa'id bin al-Musayyib (may Allah have mercy on him) said that a man married a woman, and when he went in to her he found her pregnant. The matter was brought before the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) "separated them, assigned the dower (mahr) to the woman, and gave her a hundred lashes."
Note: Marrying a Muslim woman who has committed zina is permissible, and the marriage is not annulled because of zina. That is why Allah Almighty set a waiting period (iddah) in marriage, and the Prophet (peace and blessings be upon him) required only the clearing of the womb (istibra'), and the people of knowledge are agreed that the child of zina born to a free woman is also free. It is therefore likely that this hadith, if it is authentic, has been abrogated. And Allah knows best.
This hadith is mursal.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 13894