Rapper Tekashi 6ix9ine was wounded in an attack in a gym in Florida. (TMZ)

Rapper Tekashi 6ix9ine was hospitalized after he was beaten by a group of men in a bathroom at a Florida gym in an attack caught on video.

The troubled 26-year-old rapper, whose real name is Daniel Hernandez, was wounded in a fight at a LA Fitness in Lake Worth, Florida, authorities said in a news release.

Video shows the rapper on the floor as a man stomps his ribs. A voice can be heard saying, “Take a picture. I wanna be famous now.”

Afterward, someone in the video says, “I’m a fan,” as the rapper walks out of the bathroom after the attack.

Palm Beach County Sheriff’s Office said his injuries were not life-threatening and asked for information about the assault.

The rapper’s attorney, Lance Lazzaro, told TMZ that several men attacked him without warning while he was in a sauna and that he didn’t have his security guards with him at the time of the attack. The lawyer said he tried to fight back, but there were too many attackers. Gym security heard the fight. The attackers fled, and the police were called. The rapper was hospitalized.

In July, his security guards, including a retired New York City police detective, were indicted for robbery.

The security team was indicted for allegedly chasing a man through Harlem with flashing lights and sirens blaring on their SUVs and robbing him.

“A celebrity entourage is not a police department, and Manhattan is not the Wild West,” Manhattan District Attorney Cyrus Vance Jr. said in a statement.

The prosecution of Tekashi 6ix9ine’s security team follows years of the rapper’s legal troubles playing out in multiple criminal dockets.

He pleaded guilty in 2015 to a felony count of using a child in a sexual performance.

Arrested for racketeering three years later, Tekashi 6ix9ine testified against members of the Nine Trey gang and was released to home confinement amid the COVID-19 pandemic.