Daniel Hernandez, known as Tekashi 6ix9ine, performs during a fashion show in Milan in September. (Luca Bruno/AP)

Troubled rapper 6ix9ine and five other men were indicted Monday on racketeering and firearms charges, according to a federal indictment alleging that the rapper was part of a violent gang that operated as a “criminal enterprise.”

Prosecutors allege that the Brooklyn rapper, whose legal name is Daniel Hernandez, was part of the Nine Trey Gangsta Bloods and that the gang carried out “shootings, robberies, and assaults in and around Manhattan and Brooklyn,” in addition to selling drugs.

The gang “wreaked havoc on New York City, engaging in brazen acts of violence,” Geoffrey S. Berman, U.S. attorney for the Southern District of New York, said in a statement.

The indictment alleges that 6ix9ine — also known as Tekashi 6ix9ine and Tekashi69 — and several associates took part in an April robbery of gang rivals. Prosecutors also allege that the rapper was part of a group that agreed to shoot someone who had disrespected the gang, which resulted in a bystander getting shot in July.

In a statement Wednesday, 6ix9ine’s attorney Lance Lazzaro said that his client is “completely innocent of all charges being brought against him.”

“An entertainer who portrays a ‘gangster image’ to promote his music does not make him a member of an enterprise,” he said. The rapper is known for his rainbow-colored hair, prominent face tattoos, and hits including “Gummo” and “Fefe,” featuring Nicki Minaj.

"Mr. Hernandez became a victim of his enterprise and later took steps by firing employees and publicly denounced this enterprise though a morning show,” Lazzaro added, referencing the rapper’s much-discussed interview last week on Power 105.1′s hit radio show “The Breakfast Club.” “Threats were then made against his life which resulted in this case being brought immediately.”

This is the latest in a long string of legal troubles for the 22-year-old, who has cultivated a rapidly growing fan base on SoundCloud and social media. On Instagram last week, 6ix9ine informed fans that he had canceled all of his upcoming U.S. tour dates and fired “everybody” on his team, including his former manager, Kifano “Shotti” Jordan, who was indicted alongside the rapper Monday.

It was also last week that 6ix9ine pleaded guilty to disorderly conduct, a charge stemming from a May traffic stop. The rapper had initially faced a misdemeanor assault charge, as reported by TMZ, and was accused of squeezing a police officer’s hand so hard he caused swelling. According to the site, the rapper’s attorney said he risked jail time unless he stayed out of trouble for a year.

The New York Times reported that the rapper and his fellow defendants were ordered held without bail after appearing in court Monday evening. One of the charges 6ix9ine is facing carries a minimum sentence of 25 years in prison — the maximum sentence is life in prison.

6ix9ine made headlines when he avoided jail time last month in connection with a 2015 case in which he pleaded guilty to use of a child in a sexual performance. The rapper signed a plea deal after the incident, which involved sexually explicit videos featuring a then-18-year-old 6ix9ine, another man and a 13-year-old girl. One condition of the plea deal was that he would stay out of legal trouble for the next two years.

But after two arrests this year — including the traffic stop and an altercation with a teenage fan in Houston — prosecutors argued that Hernandez had violated the agreement. According to the Times, prosecutors asked a New York State Supreme Court justice to sentence him to prison for one to three years. He was sentenced in October to four years' probation and 1,000 hours of community service.

Before his most recent arrest, 6ix9ine had been plugging his upcoming album, “Dummy Boy,” which he said would be released Friday. In an Instagram post Sunday, he teased tracks featuring Minaj and rapper Kanye West.

This story has been updated.