If you marry a pregnant woman, then her vagina is lawful if you pay the dowry, after she gives birth, flog her; the child becomes your slave...( Sunaan Abu Dawud 11.2126)
Book 11, Number 2126:
Narrated Basrah:
A man from the Ansar called Basrah said: I married a virgin woman in her veil. When I entered upon her, I found her pregnant. (I mentioned this to the Prophet). The Prophet (peace_be_upon_him) said: She will get the dower, for you made her vagina lawful for you. The child will be your slave. When she has begotten (a child), flog her (according to the version of al-Hasan). The version of Ibn AbusSari has: You people, flog her, or said: inflict hard punishment on him.