For two years, a Pottstown gang known for violence and drug dealing was careful to evade detection, authorities said, using rental cars to commit crimes and hiring people in drug addiction to buy their guns.

But the BGB gang also made rap videos and filmed its members holding drugs and guns. And that led to the arrest of four men on murder charges.

One of the videos the gang made at a drab apartment complex in the borough clearly showed the number of the apartment unit to which members fled moments after killing a man in late March, authorities said Friday.

The four men are charged in the death of Keith Robinson, who was shot multiple times in the front seat of his car on a Pottstown street.

Kyshan Brinkley, 23; Jacquan Lee, 26; Elijah Davis, 18; and Derrick Goins, 26, face charges of first- and third-degree murder, conspiracy to commit murder, and gun crimes. Goins, who had eluded police since Aug. 1, was arrested this week, the last of the four to be apprehended.

Shortly before 11 p.m. March 30, authorities said, Robinson, 41, of Pottstown, was sitting in his Infiniti SUV on a residential street when 10 bullets fired in rapid succession shattered the passenger window.

For months before his death, Robinson’s girlfriend of two years told investigators, he had feared the men of BGB. In the past, he’d refused to sell Percocet to one of them. Then he heard he was on the gang’s kill list.

As Robinson sat dying in his car, .40-caliber casings lay on the ground. About 500 feet from the crime scene, investigators found a small black jacket in the trash.

A witness told police he had seen a slim man dressed in black “pacing back and forth” in a nearby alley about 20 minutes before Robinson was shot. Surveillance footage showed a man running from the shooting scene. The witness picked Goins out of a photo lineup.

At 11 p.m., seven minutes after officers were called to the scene of the shooting, police said, BGB members drove to an apartment complex on Manatawny Street, where they had a unit they used to sell drugs, store guns, and make their music videos.

Five people spilled out of a black Dodge Caravan Goins had rented the day before the murder and ran into the apartment, police said. They came out minutes later and drove to a nearby gas station, where Goins got out of the passenger seat of the car. He was dressed in black.

Soon after, the group took off for a nightclub in North Philadelphia, where Goins stayed for hours before returning to Pottstown.

Robinson’s death was ruled a homicide the same day.

For months, Montgomery County detectives and Pottstown police had been investigating the BGB gang, studying the videos gang members recorded of themselves holding bags of drugs and wielding guns. Investigators probing Robinson’s death interviewed a man who had been at the gang’s hangout hours before the shooting and taken a cell phone photo of four semi-automatic handguns that investigators later determined may have been used to kill Robinson.

A subsequent search of the apartment led police to seize a loaded Colt .45 semiautomatic pistol, a Glock magazine and bullets, and ammunition that matched the casings at the murder scene.