Mark Anthony Cox pleaded guilty to first-degree murder, murder of an unborn child, robbery with a dangerous weapon and felony larceny in the killing of restaurant manager Danielle Watson at the Flying Biscuit Cafe in May, The Charlotte (N.C.) Observer reported.
Watson, 25, was seven to eight weeks pregnant when Cox killed her.
Cox had been released from prison a few months before the attack, after serving more than three years for robbery with a dangerous weapon and breaking and entering.
If he had gone to trial, Cox would have faced the prospect of execution.
He was sentenced Thursday to two life sentences without parole.