A Bensalem teenager has been charged with voluntary manslaughter after police say he killed a Philadelphia man in December during a robbery.

William Hunter, 16, was arrested Wednesday and also faces robbery and gun charges and related offenses. He waived his preliminary hearing and will be arraigned in Bucks County Court in August.

Hunter remained in custody Thursday in lieu of 10% of $5 million bail. His attorney, David Zellis, did not return a request for comment.

Hunter was part of a group of four teenagers who set up a meeting to sell stolen guns to Yusef McNeal, 18, and another man on Dec. 1, according to the affidavit of probable cause for his arrest.

» READ MORE: Neighbors jolted by fear after 4 people were shot, 1 dead, at a Bucks County apartment complex

They agreed to meet the men at the Commons at Fallsington, an apartment complex in Falls Township, and sell them two guns for $1,000, the affidavit said. Instead, the teens planned to hand over a backpack weighed down with bricks and speed off with the buyers’ money.

Surveillance footage from the apartment complex recorded the exchange, and showed both groups arriving in separate vehicles, the affidavit said. McNeal and the other man are seen speaking with Hunter and the teens for several minutes before an altercation breaks out, which investigators say stemmed from a disagreement over money.

Both groups opened fire, McNeal was struck in the chest, and three of the teens inside the car were also shot, police said. All of the victims fled the scene and were taken to nearby hospitals.

Hunter was hit in the upper chest and taken to Jefferson Torresdale Hospital, according to the affidavit. McNeal was taken to Lower Bucks Hospital, where he later was pronounced dead.

Detectives later determined that Hunter fired the shot that killed McNeal with a .40-caliber Smith & Wesson handgun he had owned for a few months, the affidavit said. In an interview with police, Hunter admitted he brought the gun with him on that day “in case something went wrong.”