Two days before rapper Tekashi 6ix9ine was indicted on gang-related racketeering and firearms charges, federal agents visited him to warn that his life was in danger.

Several of his associates—who had just been fired and dissed by him on a radio show—were overheard on a wiretap saying they wanted to “super-violate” him, investigators disclosed.

The agents brought the 22-year-old star to Homeland Security’s New York headquarters, explained the situation, and offered to put him up in a hotel, but Tekashi 6ix9ine declined the offer and returned home, where authorities kept him under 24-hour surveillance.

That ended Monday when Tekashi—whose real name is Daniel Hernandez—was arrested and brought to federal court in Manhattan for an arraignment on six counts that could put him away for decades.

According to the indictment, the Brooklyn-born artist is a member of the Nine Trey Gangsta Bloods, a gang that allegedly peddled fentanyl and other narcotics and engaged in “brazen acts of violence,” Manhattan U.S. Attorney Geoffrey Berman said in a statement.

Court papers allege that Tekashi was no mere figurehead. In April 2018, he allegedly took part in a gunpoint robbery of Nine Trey rivals in Midtown Manhattan, videotaping the heist from a nearby car. According to prosecutors, he even took the stolen backpack to his apartment, where investigators found it—the victim’s ID still inside—during a search earlier this fall. Also recovered was an AR-15 pistol.

That same month Tekashi was photographed at the Barclays Center in Brooklyn with an associate, Fuguan “Fu Banga” Lovick, who is accused of firing shots at gang rivals.

Three months later, prosecutors said, Tekashi and his crew agreed to shoot someone who had disrespected the gang. The result was an innocent bystander being wounded at a barbecue in Brooklyn, they alleged.

Whatever solidarity existed among the reputed Nine Trey members, however, apparently evaporated when Tekashi abruptly announced he was axing manager Kifano “Shotti” Jordan and other members of his team and canceling his planned tour.

Tekashi’s mother, fighting back tears, was closely guarded by agents at his Monday arraignment, protecting her from retaliation by relatives of his five co-defendants.

In addition to Lovick and Jordan, the indictment charged Faheem “Crippy” Walter, who was previously charged with gang assault after a confrontation at a Tekashi celebration that left him wounded; Jamel “Mel Murda” Jones; and Jensel “Ish” Butler.

Tekashi, a chunk of his rainbow-colored hair pulled away from his heavily tattooed face, appeared shaken as he sat in court, his hands cuffed and his eyes closed at points. He answered the judge’s questions in a soft, polite voice that sounded nothing like his aggressive stage rapping.

His attorney, who has previously denied that his client is in a gang, noted that prosecutors had offered no evidence showing him shooting a gun or committing an act of violence himself.

He offered to put up $1.1 million in cash for bail, but the judge ordered him held until the next court date. If he is convicted of all the charges, he would face a mandatory minimum sentence of 32 years.

Before the racketeering arrest, Tekashi was already on probation after pleading guilty to state charges of making videos of a 13-year-old in a sexual performance in 2015.

The rapper admitted in detail to the sex crime but escaped jail time as a youthful offender—with the requirement that he stay out of trouble. But law enforcement has entered his orbit several times since then.

Police say he left his sentencing in that case with a “carload of known gang members.” And on Nov. 8, gunfire interrupted his filming of a video in Beverly Hills, in which Kanye West and Nicki Minaj were set to take part.

Last week, Tekashi appeared in Brooklyn Criminal Court on a charge of disorderly conduct related to an incident in May, when an officer allegedly was injured after stopping him for driving with a suspended license. He was fined $120.

In his 2015 plea agreement, he was to demonstrate “that the crime he committed was the result of a serious mistake he made in his youth, one that was not indicative of the law abiding life he intended to lead as an adult,” according to a memorandum written last month by the Manhattan District Attorney's Office.

“Since defendant’s plea of guilty on October 20, 2015, he has not only become a successful recording artist, but is now a self-admitted member of a violent gang, the 9 Trey Bloods,” the memo states, noting that such affiliation is “patently inconsistent with his acceptance of responsibility and rehabilitation.”

“He has... been arrested multiple times for crimes he committed this year” and “exacerbated his own violent conduct by using his public platform and significant following to provoke and promote incidents of gun violence,” according to the memo.

A July 28 video posted to his Instagram account shows Tekashi getting into a car in Miami, picking up what appears to be an automatic weapon and saying, “Trey Way!”