A West Philadelphia man who killed his ex-girlfriend at a gas station in King of Prussia last week was arrested early Wednesday and charged with murder, authorities said.

Rafiq Thompson, 38, faces counts of first- and third-degree murder, firearms violations, and related offenses in the death of Tamara Cornelius. Prosecutors are also expected to charge him in the death of Cornelius’ unborn child — she was four months pregnant when Thompson allegedly gunned her down at an Exxon station late Friday.

At the time of his arrest, Thompson was on probation for a 2016 attack on another former girlfriend. He remains in custody, denied bail. His attorney, Laurence Narcisi, did not return a request for comment.

Upper Merion Township police officers found Cornelius, 31, suffering from multiple gunshot wounds at the Exxon station on North Gulph Road just before 10:30 p.m. Friday, according to the affidavit of probable cause for Thompson’s arrest. Medics took her to Paoli Hospital, where she was later pronounced dead.

Witnesses told police Cornelius was shot by a man who had followed her to the gas station and started arguing with her, the affidavit said. One witness told detectives he heard Cornelius apologize to the shooter as she lay wounded, while another said the gunman screamed that he didn’t care if he went to jail.

Detectives said Thompson and Cornelius had encountered each other earlier that night at the Cheesecake Factory at the King of Prussia Mall. Surveillance footage showed Cornelius and Thompson arriving not long after each other, and meeting in the restaurant’s vestibule.

It remained unclear Wednesday how or why the two ran into each other at the restaurant.

.

Thompson left the restaurant alone a half-hour later, the affidavit said. And about 30 minutes after that, the document said, Cornelius left the restaurant. Other surveillance footage showed Cornelius driving toward the Exxon, with Thompson closely tailing her with his headlights off, the affidavit said.

They both then pulled into the gas station, where surveillance cameras captured what followed: The two argued, and Thompson pulled out a gun and shot Cornelius as she pumped gas into her car, according to the affidavit. When she tried to run away, Thompson followed and continued to shoot.

He then fled, prompting District Attorney Kevin Steele to offer a $5,000 reward for information leading to his arrest. Narcisi, Thompson’s attorney, later arranged for his surrender.

Cornelius’ family said Wednesday they were grateful that Thompson had been arrested. But they are reeling from the loss of Cornelius, a mother of three who they said had dated Thompson for only a few months last year. She was in a new relationship and was pregnant with her current boyfriend’s child, said her aunt, Lisa Cornelius.

The couple had just bought a house in West Oak Lane, she said, and they were filling it with furniture and already building memories.

“Tamara was a beautiful person with a heart of gold,” she said. “We can’t understand why she’s gone. She had so much going for herself.”

Lisa Cornelius said she was close to her niece, and they spoke on the phone often, sharing recipes and planning family parties. But she said she learned only after her niece’s death that Thompson had been stalking and harassing Cornelius for months, but she hadn’t contacted police.

“I wish I would’ve been able to talk to her, to tell her to get help,” her aunt said. “She didn’t have to go through this alone.”

» READ MORE: A Philadelphia teen killed his ex-girlfriend outside a SEPTA station last year. A jury is being asked to decide why.

At the time of his arrest, Thompson was on probation for a 2018 aggravated-assault conviction for striking his former girlfriend with his van and charging at her with a knife after she broke up with him. The attack was thwarted by the woman’s brother and a Philadelphia police officer who happened to be driving by at the time.

Thompson had been harassing the woman, court records show, and she said he once set a mattress on fire in her backyard. She had obtained a protection-from-abuse order against him before the 2016 attack, records show.

He spent three years in prison and was paroled in June 2019.