[What you need to know to start your day: Get New York Today in your inbox]

The Brooklyn-based rapper and Instagram star known as 6ix9ine, whose talent as a performer is often overshadowed by a magnetic attraction to trouble, was part of a violent gang that sold drugs, robbed rivals and shot at people who crossed them, according to a federal indictment unsealed on Monday.

The rapper, whose legal name is Daniel Hernandez, 22, was charged along with five other men, some of whom were once part of his management team, including Kifano Jordan, known as Shottie.

Mr. Hernandez and Mr. Jordan were part of a gang known as the Nine Trey Gangsta Bloods, and committed a series of violent crimes and drug-trafficking offenses, including attempted murder and armed robbery, the indictment said. In one instance, the indictment said, a plan to shoot someone who had been disrespectful to the group led to a July 16 shooting of an innocent bystander in the foot. On April 21, one of the men shot at a rival inside the Barclays Center, but no one was hit.

Gang members also robbed a man at gunpoint in Times Square in April, in an attack that prosecutors said was directed, and filmed, by Mr. Hernandez himself.