Murder suspects, from left, Brian Anthony Mackall, 20, Oliver Waltz Farley, 19, and Re’Quan Kasim Hopson, 21. (Montgomery County Police)

The plan, as revealed in court Wednesday, was to get into the drug dealer’s house in Silver Spring and rob two pounds of pot.

Moments after arriving, a gunshot sounded in an upstairs bedroom, according to police, even as the victim kept clutching the marijuana. One man punched him until he released his hold on the drugs. The attackers fled, followed by a woman who rapped on the window of the getaway car and screamed “murder!”

Another suspect ran off, getting away in an Uber.

The chaos, described Wednesday by police’s newly filed arrest affidavits and by prosecutors in court, unfolded about 9:50 p.m. July 19 along Belvedere Boulevard in Montgomery County. The victim — Jon-Christian Kemachet-Webster, 20 — was taken to Holy Cross Hospital, where he died.

On Wednesday, police said they have charged three suspects with first-degree murder.

The case represents the fourth time in the county’s 10 homicides this year that there has been “a nexus to marijuana distribution,” said Capt. Darren Francke, commander of the county police department’s major crimes unit.

“A significant number of people in society are glamorizing marijuana use while failing to discuss or think through the extreme risk of buying and selling it,” Francke said.

One suspect, Oliver Waltz Farley, 19, of Arlington, Va., appeared in Montgomery County District Court on Wednesday to have terms of his bond reviewed by a judge.

“This was a drug deal that went bad,” Montgomery Assistant State’s Attorney Mark Anderson said in court. “These guys came armed to this.”

An attorney representing Farley, John Lavigne, noted Farley “actually has a lot of positive things that have been going for him.” Among them, Lavigne said, were “very concerned and very supportive” parents, who sat in the front row of the courtroom. Farley also is a trained audio-video technician, having held internships or worked at a local university, a Washington think tank and at a law firm, according to Lavigne and court records. Lavigne indicated Farley had been arrested last week at the firm where he worked for a contractor.

“He is not alleged to have been the shooter,” Lavigne said.

District Judge Eric Nee ordered Farley held without bond, pending further court actions. Farley’s parents declined to comment after the hearing.

Police identified the other suspects as Re’Quan Kasim Hopson, 21, of Arlington, who on Wednesday was being held in jail in Virginia; and Brian Anthony Mackall, 20, of Suitland, Md., who on Wednesday was being held in jail in the District. Both are expected to be brought to Montgomery County. Mackall was the alleged shooter, according to the prosecutor.

It is unclear from court records if Mackall or Hopson have attorneys yet in the case.

According to charging documents, detectives believe the day before the murder, Farley called an acquaintance about buying two pounds of marijuana. The next night, Farley met the acquaintance, whose identity detectives kept confidential in records because the person fears reprisal.

That meeting led to the three suspects arriving at the home on Belvedere Boulevard: Hopson, who was driving, stayed in the car, while Farley and Mackall went inside, according to police.

The victim, Kemachet-Webster, “took out two large packages of marijuana,” Detective Frank Springer wrote in a court affidavit. A shot was fired, striking Kemachet-Webster in the chest.

“Oliver [Farley] then began punching Kemachet-Webster in an attempt to pull the large marijuana packages from the victim’s grasp,” Springer wrote, adding Farley “grabbed the two large packages and handed one to the shooter as he exited the room.”

Detectives used witness accounts and cellphone records to identify suspects.

On July 20, Hopson was arrested in Arlington County for alleged offenses unrelated to the alleged homicide. Montgomery detectives interviewed him, and Hopson said he drove Farley and Mackall to the home, police said.

Police then picked up Farley and Mackall.

In court Wednesday, the prosecutor, Anderson, said detectives have established Farley’s presence in the home based on his statements to detectives, cellphone records, and his Uber ride out of the area.

Detectives also recovered “a substantial amount of narcotics” in Arlington, with packaging that matches what detectives say was used for the pot in the home.