Rapper XXXTentacion was shot and killed in Florida, the Broward County Sheriff's Office announced Monday afternoon. He was 20. The sheriff's office said the rapper, whose given name was Jahseh Onfroy, died in the hospital after a shooting in Deerfield Beach, Florida.

Detectives said Onfroy was leaving RIVA Motorsports shortly before 4 p.m. ET when he was approached by two armed suspects. They said at least one of the suspects opened fire, striking Onfroy. Both suspects fled the scene in what police described as a "possible robbery."

He was transported to a nearby hospital where he was pronounced dead, the sheriff's office said.

The adult male victim has been confirmed as 20 year old Jahseh Onfroy aka rapper #XXXTentacion. — Broward Sheriff (@browardsheriff) June 18, 2018

The sheriff's office urged anyone with information on the shooting to contact homicide detectives at (954) 321-4210.

Get Breaking News Delivered to Your Inbox

Earlier Monday, he posted to Instagram that "he was planning a charity event for this weekend in Florida."

Onfroy's music first rose to prominence in 2015 when he released his track "Look at Me!" on SoundCloud. In August 2017, he released his debut album titled "17" that climbed to No. 2 on the Billboard 200 chart. In March of this year, his sophomore album "?" reached the No. 1 spot on the Billboard 200 chart.

However, the rapper faced serious legal trouble, including more than a dozen felony charges. He was awaiting trial on charges that he allegedly beat his pregnant girlfriend -- an allegation he denied.

Spotify and Apple Music removed his music from their curated playlists last month but later rolled back its anti-hate policies after they were criticized by some players in the music industry.

Artists across the music industry mourned Onfroy on Monday, including rappers Kanye West and Big Sean.

rest in peace 🙏🙏🙏 I never told you how much you inspired me when you were here thank you for existing pic.twitter.com/QU7DR3Ghbw — KANYE WEST (@kanyewest) June 18, 2018

My heart dropped when I heard about @xxxtentacion, I feel like we only got to see a glimpse of his artistry. I didn’t know him personally but I respect how passionate he was about his music and message. Nobody deserves this kind of ending. gone too soon, damn! RIP — Sean Don (@BigSean) June 19, 2018

Absolutely in disbelief ... RIP @xxxtentacion You will be missed my so many — marshmello (@marshmellomusic) June 19, 2018

Really sad Rip xxx.. so sad to lose good artist. 🙏🏾🙏🏾🙏🏾🙏🏾 — T-Raww (@Tyga) June 18, 2018

Drummer and producer Travis Barker tweeted that he was at a "loss for words."

"Loved collaborating with you. You were a true artist, one of the most f***ing talented of our time," Barker said.