A Stockholm court has found A$AP Rocky guilty of assault but spared him prison in a case that outraged the US rapper’s fans and sparked a diplomatic row when Donald Trump questioned the fairness of Sweden’s judicial system.

The court also convicted two members of A$AP Rocky’s entourage of the same crime in connection with a street brawl in the Swedish capital on 30 June, but said the assault was “not of such a serious nature that a prison sentence must be chosen”.

The platinum-selling artist, whose real name is Rakim Mayers, and his bodyguards David Rispers Jr and Bladimir Corniel argued that they had been acting in self-defence during the incident, which left them facing up to two years in prison.

Mayers told the court during the hearing this month that he and his entourage had tried to avoid a confrontation with two men who he said were following them. One of the pair, the rapper alleged, picked a fight with one of his bodyguards.

Profile Who is A$AP Rocky? Show Named after one half of the hip-hop duo Eric B. & Rakim, Rakim Athelaston Mayers was born in New York in 1988. He adopted the name A$AP Rocky when he began his career in 2007, joining the A$AP Mob crew. Mayers had a troubled childhood. His elder brother was murdered, his dad was arrested for drug dealing, and he spent some time moving around homeless shelters with his mother and sister. His older sister died of a drug overdose in 2016. Mayers himself served two weeks in prison for drug dealing in 2004. He came to prominence with the release of the mixtape Live.Love.A$AP in 2011. Having signed to a major-label deal for a reported $3m, his 2013 debut album, Long.Live.A$AP debuted at No 1 on the US Billboard 200. Follow-up At.Long.Last.A$AP was also a No 1 album in the US, certified as a platinum seller, and featured a seemingly unlikely collaboration with Rod Stewart. His creative partner and best friend A$AP Yams (Steven Rodriguez) died in January 2015 in an accidental drug overdose. In 2016, Mayers became the first African-American to be the face of Dior Homme.

In 2013, he was charged with slapping a woman at Philadelphia's Made in America festival. This was eventually settled out of court in 2015. He has been involved in other altercations, in Toronto, New Zealand, and London, the latter involving a bagel and an Uber in Brick Lane. He unexpectedly declared a love of the Piccadilly Line while delivering the Red Bull Music Academy lecture in the city, and has collaborated with British rapper Skepta on the acclaimed track Praise the Lord (Da Shine).

He has caused controversy by appearing to describe the Black Lives Matter movement as a “bandwagon”, saying “I don’t wanna talk about no fucking Ferguson and shit because I don’t live over there. I live in fucking SoHo and Beverly Hills. I can’t relate.” Photograph: John Ricard/Getty Images

A full-scale brawl ensued during which the victim, Mustafa Jafari, 19, a Swedish resident of Afghan origin, suffered cuts to his arms, legs and head and a fractured rib, for which he needed hospital treatment.

The court rejected the claim of self-defence in its ruling, finding that the three men “assaulted the victim by hitting and kicking him as he lay on the ground” and that Mayers, 30, “also threw the victim to the ground and stepped on his arm”.

It said they were “not in a situation where they were entitled to self-defence”, ordered them to pay Jafari 12,500 kronor (£1,000) in damages and handed down conditional sentences, meaning they face no prison sentence in Sweden unless they commit a similar offence in the country again.

The three, who spent nearly a month in detention but were released at the end of their trial on 2 August pending the verdict and have since returned to the US, were not in Stockholm to hear the ruling.

But Mayers’ lawyer, Slobodan Jovicic, said his client was “incredibly disappointed” by the verdict. “We had hoped for an acquittal,” he said, adding that Mayers had not decided whether to appeal.

At his first performance on Sunday following his release, in Anaheim in California, the rapper thanked fans and called the experience in Sweden scary and humbling. “I need y’all to keep praying for me,” he told the crowd, saying he hoped he would not have to return to serve a jail sentence.

The state prosecutor, Daniel Suneson, had demanded a six-month sentence in the case, which sparked fury among Mayers’ fans and inflamed international tensions after celebrities including Kim Kardashian West and Justin Bieber backed a #JusticeForRocky campaign and Trump publicly demanded Mayers’ release.

Much of the trial focused on whether a bottle had been used in the assault. The presiding judge, Per Lennerbrant, said in the ruling it could “not be established by whom” a bottle was used, and this “affected the assessment of the seriousness of the crime”.

He said actions like those committed by Mayers and his crew would normally carry a two-month prison sentence, but there was “no reason to fear the accused are going to be repeat offenders”.

Suneson said the court had found the three men guilty of assault, making “the same assessment as I did – with one exception, the involvement of this bottle”. Jafari’s lawyer, Magnus Strömberg, said his client was “not entirely satisfied” with the verdict either but was pleased assault had been established.

The court was shown footage published on the celebrity news site TMZ showing Mayers hurling a man to the ground as he and his entourage punched and kicked him. Other members of the group were filmed attacking another man.

The rapper subsequently posted a video on Instagram that showed him being followed by the two men who were later attacked, arguing: “We don’t know these guys and we didn’t want trouble. They followed us for four blocks.” The prosecution argued these clips had been heavily edited.

The case sparked a diplomatic spat after Kardashian West appealed directly to Trump, prompting the president to call the Swedish prime minister, Stefan Löfven, and offer to “personally vouch for [Mayers’] bail, or an alternative”.

Löfven said that in the Swedish judicial system, prosecutors and courts were independent, after which Trump tweeted that he was “very disappointed”, adding: “Give A$AP Rocky his FREEDOM. We do so much for Sweden but it doesn’t seem to work the other way around. Sweden should focus on its real crime problem!”