NEW YORK—The rapper known as Tekashi 6ix9ine was in federal custody Monday awaiting a Manhattan court appearance.

The Brooklyn-based rapper, whose legal name is Daniel Hernandez, was among four people arrested on racketeering and firearms charges.

An attorney who has previously represented Hernandez did not immediately respond to an email seeking comment Monday.

The authorities also arrested three of Hernandez’s former associates, Kifano “Shotti” Jordan, Jensel “Ish” Butler and Faheem “Crippy” Walter. It is unclear whether they had defence attorneys.

6ix9ine has been one of the most ascendant and controversial names in hip-hop in recent months. His album Day69: Graduation Day was among the top records on iTunes following its February release.

He is also known for the multiplatinum hit “Fefe” with Nicki Minaj, which peaked at No. 3 on the pop charts, and Stoopid, featuring the incarcerated rapper Bobby Shmurda.

But 6ix9ine also has had a series of run-ins with law enforcement and has publicly identified himself as a member of a violent New York gang, 9 Trey Bloods.

The 22-year-old recently pleaded guilty to disorderly conduct in Brooklyn Criminal Court in connection with a May traffic stop.

In a 2015 case in New York, 6ix9ine was sentenced to probation for his involvement in a sexually explicit video of a 13-year-old girl.

The video, posted on social media, showed the girl performing a sex act on another man while 6ix9ine “stands behind the child making a thrusting motion with his pelvis and smacking her on her buttocks,” according to court documents.