A Philadelphia man was sentenced to 39 to 78 years in state prison Wednesday after pleading guilty to strangling his ex-girlfriend, who was pregnant with his child.

Jaleel Loper, 30, entered the plea to third-degree murder, murder of an unborn child, stalking, and related offenses during a hearing before Bucks County Judge Gary B. Gilman. The negotiated plea came as Loper was preparing to face trial in the 2018 slaying of Anna Angok, a crime for which prosecutors had planned to seek the death penalty.

Loper’s attorney, Suzette Adler, did not return a request for comment.

Angok, 29, was found dead in her Croydon apartment in September 2018, investigators said. Her 2-year-old daughter, who was unharmed, was sitting in a chair next to her body.

Detectives later learned that Angok, a South Sudan native who moved from Kenya to the United States in 2000, had ended her relationship with Loper hours before her death. Loper had sent Angok a string of threatening text messages in the days before the murder, including warning her to “watch [herself] at all times,” according to the affidavit of probable cause for his arrest.

On the day of the murder, Loper asked a coworker’s grandmother for a ride to Angok’s residence at the Glen Hollow Apartments, only a few miles from Family Food Products in Bensalem, where he worked.

Detectives believe he placed a 911 call at 6 p.m. that day and asked police to “please hurry” to Angok’s apartment. A few minutes later, Murrey Alderfer, Angok’s foster father, said he answered a call from Angok’s phone number and a man whose voice he said he didn’t recognize told him to “hurry up” and head to her apartment.