File: A$AP Rocky said he was disappointed with the verdict and that it had been a difficult time.
The 30-year-old rapper, whose real name is Rakim Mayers, hugged his mother in the courtroom after the Stockholm district court's presiding judge Per Lennerbrant announced he would be released pending the verdict, which will be delivered on 14 August.
Mayers has been held in Sweden since 3 July when he was arrested following a brawl in Stockholm on 30 June, which saw him and his crew embroiled in a fight with a 19-year-old plaintiff.
He and two others had been held in custody ahead of their trial because the court deemed him a "flight risk".
His detention has sparked a campaign for his release by his fans and fellow artists, with an online petition called #JusticeForRocky garnering more than 640,000 signatures. Social media campaigns have even urged fans to boycott Swedish brands such as Ikea.
The New York-born rapper thanked his fans in an Instagram post after his release.
"Thank you from the bottom of my heart to all of my fans, friends and anyone across the globe who supported me during these last few weeks, I can't begin to describe how grateful I am for all of you," the post said.
Trump, who has repeatedly called for the rapper to be freed -- drawing complaints of interference from Swedish politicians -- also expressed his approval after the announcement.
"It was a Rocky Week, get home ASAP A$AP!," the president tweeted.
On Friday, the third and final day of the trial, witnesses including the rapper's bodyguard took the stand.
Fans gathered outside the court shouting "Free Rocky" and "Free Flacko," invoking the rapper's different nicknames while playing his songs over loudspeakers.
Prosecutor Daniel Suneson called for a jail sentence of about six months, saying Mayers did not seem "scared" as he had claimed, and there had been no need for self-defence.