FORT LAUDERDALE, Fla. — A suspect has been arrested in connection to rapper XXXTentacion's death.

Dedrick D. Williams, 22, was arrested by Broward County Sheriff's Office Wednesday on murder charges, according to a police statement obtained by USA TODAY Thursday. He was taken into custody shortly before 7 p.m. in Pompano Beach.

XXXTentacion, whose real name was Jahseh Dwayne Onfroy, was ambushed by two suspects as he pulled his electric BMW i8 away from RIVA Motorsports in Deerfield Beach, Fla. (The dealership lists its address as Pompano Beach).

He was transported to a local hospital, where he was pronounced dead at 5:40 p.m. ET Monday.

Bank records revealed that he had withdrawn cash from an ATM that day, possibly with the intention of purchasing a motorcycle.

His Florida lawyer, David Bogenschutz, told USA TODAY that detectives were considering the possibility XXXTentacion was the victim of a random armed robbery: The rapper was driving a $147,000 car, Bogenschutz said, and a small Louis Vuitton bag he typically carried was missing.

Since his death, fans have mourned the rapper on the streets in Florida and in California, and by listening to his music.

On Tuesday night, Nielsen Music revealed that on Monday alone, 33,000 copies of his digital song and album catalog were sold in the hours following his murder outside a Miami-area motorcycle dealership. That's a jump of 1,603 percent from just one day earlier.

He is also being memorialized on Spotify, which a month earlier had removed his music from playlists, citing a short-lived policy banning the promotion of artists who engage in "hateful conduct."

At the time of his death, XXXTentacion was facing trial on charges that he beat his pregnant girlfriend, Geneva Ayala. She told The Miami New Times that he had threatened to kill her and her unborn child in early October 2016.

Although Ayala had accused him, she said she was devastated by his death and lashed out on Twitter on Tuesday: "I’m broken," one of her tweets read.

The Miami-Dade County State Attorney’s Office, which was prosecuting him for domestic violence, now may drop the case because the defendant is dead. Bogenschutz, the Fort Lauderdale lawyer who represented the rapper in the criminal case, said XXXTentacion was moving to "resolve" the matter at the time of his death.

News of the arrest surfaced on Twitter early Thursday through the slain rapper's mother, Cleopatra Bernard Onfroy. Bogenschutz, who spent hours with her at the hospital and at her son's house the night of his death, told USA TODAY she is the rapper's main survivor.

"She is stunned, devastated, somewhat rudderless at this point, she's a very young mother, 36 or 37, and one of the nicest ladies you'd ever meet," said Bogenschutz, "When a door closes that fast and that violently, it takes a day or two before it hits you. It's been very, very difficult."

Bogenschutz, who said he will be handling the settlement of XXXTentacion's estate, said funeral and memorial arrangements are pending.