Two Philadelphia men have been charged with first-degree murder in the fatal shooting in June of a 22-year-old man in Chester County while he was sitting inside a car with his girlfriend and her 1-year-old daughter, prosecutors said Thursday.

Lynelle Unique Flowers, 26, of Southwest Philadelphia, and Zahir Yusef Randall, 21, of Crescentville, were being held without bail at the Chester County Prison pending their preliminary hearings. The Pennsylvania State Police announced their arrests on Wednesday.

Tarik Scott Jr. was sitting in the passenger seat of his girlfriend’s car parked in the driveway of Scott’s family home in Sadsbury Township around 2 a.m. on June 22 when Flowers allegedly approached and fired five shots. Scott’s girlfriend, who was in the driver’s seat, jumped into the backseat with her infant daughter. They were not injured. Scott was pronounced dead at the scene.

Flowers had threatened Scott’s family in the days before the shooting because he was embroiled in a child-custody dispute with Scott’s sister and allegedly had beaten her when she tried to take two children from their shared home in Southwest Philadelphia, according to the police criminal complaint.

The ensuing investigation, as detailed in the complaint, shows that state police painstakingly compiled location records from cellphones, video surveillance from business and residential cameras, traffic cameras, and multiple license-plate readers to track the car allegedly used by Flowers and Randall as they left Southwest Philadelphia all the way to the block where the fatal shooting happened.

Surveillance video shows the black Mercedes-Benz C400 registered to Randall arriving on the block an hour before the shooting and then leaving the scene immediately afterward, according to the complaint.

Scott’s father told investigator’s that he believed Flowers was involved in his son’s death because of what happened to his daughter. Flowers allegedly assaulted two other Scott family members during the same incident with the daughter, and he allegedly made repeated harassing calls to the father.

Flowers had once lived with the Scott family in Coatesville and allegedly got into a fight with Tarik Scott Jr. when Flowers was accused of stealing money, according to the complaint.

Flowers was known to possess the same type of handgun used in the homicide, the complaint states.

The night of the shooting, Scott went with his girlfriend and her daughter to a nearby Wawa on West Lincoln Highway to get food and gas, police said. When they returned, they stayed inside the girlfriend’s vehicle.

On their way from Southwest Philadelphia to Sadsbury Township, Flowers and Randall stopped at a Wawa in West Goshen Township, according to the complaint. Investigators said Randall made two separate purchases with some type of card and is seen on video inside the store using his phone.

According to the complaint, there is no location data from Flowers’ phone from 1 a.m. until just after 11 a.m. Investigators believe he put his phone into “airplane mode,” or turned it off.

In a statement, Chester County District Attorney Deb Ryan said: “The defendants lay in wait under cover of darkness to execute an innocent man while his girlfriend and her one-year-old child were inside the car with him. This cold-blooded and premeditated murder is another senseless crime. My condolences go out to the victim’s family for the heartbreaking loss of their loved one.”

Besides being charged with first-degree murder, both men face numerous counts of conspiracy and related offenses.

Court records did not list lawyers for either defendant.