The Broward County police chief said that after the attack, the two suspects fled in a dark SUV.
At the time of his death, Onfroy was awaiting trial on over a dozen felony charges and allegations of domestic violence against his then-pregnant girlfriend.
The rapper, whose lyrics were filled with insecurity and whose real life was repeatedly marred by violence, was gunned down in his black BMW i8, in broad daylight near a motorcycle store in Deerfield Beach north of Miami, the Broward County sheriff's department said. In a separate post, he told grieving fans, "You're not alone".
Rapper J Cole said: "This for me f***ed up".
His brief career was mired in controversy. In March, a judge ruled that XXXTentacion could be released from house arrest in order to tour in support of his new album.
"This got me f-ked up".
In an interview this month with the Miami New Times, XXXTentacion described his upbringing, which included seeing his mother infrequently and being raised by friends, family and baby sitters.
The controversial rapper has previously made headlines for a music video that depicted the "lynching" of a young white boy and he was one of the artists who Spotify removed from playlists based on its policy of removing "hate content".
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. "I at least want to know that the kids perceived my message and were able to make something of themselves and able to take my message and use it and turn it into something positive", adding, "And to at least have a good life". "Your mind is limitless ... you are worth more than you can believe".