A nightclub bouncer is on trial for the murder of pregnant teenager Nikitta Grender, who was expecting his cousin's child.
Carl Whant allegedly raped the heavily pregnant 19-year-old before stabbing her in the neck and stomach at her flat in Lliswerry, Newport, on 5 February last year.
Whant, 27, then burned the house down to make the murder "look like a tragic accident", Newport crown court was told.
Grender was due to give birth less than two weeks after her murder and prosecutors said they would attempt to prosecute Whant for child destruction, a charge that is rarely used.
Prosecuting, Gregg Taylor QC said: "At her own flat in the early hours of Saturday morning, she should have been safe for the rest of the night.
"But at some point that morning, someone entered the flat, someone raped her, someone murdered her and in the process killed her unborn child."
The day Grender was murdered, Whant had been watching rugby with his cousin, Ryan Mayes, before he said he was popping out to his grandmother's house nearby to fetch some cigarettes, the court heard.
It was claimed that Whant went to Grender's flat instead and killed her.
The jury of eight men and four women heard that Mayes, 18, later wrote on a Facebook page dedicated to his deceased partner: "You meant the world to me and the baby would have.
"You were the best thing ever created. My heart has been ripped open."
Whant, from Newport, denies murder, rape, arson and child destruction.
The trial continues.