Sunan Ibn Majah, Book 21, Hadith 80 (Ibn Majah 2696)

Mu'adh bin Jabal, Abu Ubaidah bin Jararah, Ubadah bin Samit and Shaddad bin Aws narrated that the Messenger of Allah (ﷺ) said:

“If a woman kills someone deliberately, she should not be killed until she delivers what is in her womb, if she is pregnant, and until the child's sponsorship is guaranteed. And if a woman commits illegal sex, she should not be stoned until she delivers what is in her womb and until her child's sponsorship is guaranteed.”