A$AP Rocky pleaded not guilty as his assault trial got underway in Sweden Tuesday, saying that he acted in self-defence.

The American rapper, real name Rakim Mayers, is facing two years in jail over claims he and his entourage attacked 19-year-old Mustafa Jafari on June 30 - hitting him with a bottle while also punching and kicking him.

Renee Black, the singer's mother, was in court watching her son as he was led into the dock in handcuffs, wearing a jacket with 'A$AP Lifestyle' written on the back.

The trial began as Sweden's newspaper revealed that Jafari has a lengthy criminal history including prior convictions for heroin, assault and petty theft.

A$AP Rocky, real name Rakim Mayers, appeared in in Stockholm District Court on Tuesday over claims he attacked 19-year-old Mustafa Jafari in the city last month (court sketch showing Mayers in green front right, and his mother sitting behind him, centre)

Meanwhile his 20-year-old friend, who will appear as a witness in the case after police found there was not enough evidence for him to press charges, has also been in frequent trouble with the law.

The friend will be escorted into court by police because he is currently in jail accused of theft and knife crime.

The charges relate to the alleged theft of two jackets in central Stockholm on July 19.

His most recent arrest came just days after he was freed from jail for another theft - taking some sunglasses - for which he was sentenced to 21 days in jail.

Both men are originally from Afghanistan. Jafari came to Sweden as an undocumented migrant from Iran in 2015. It is not clear when his friend arrived.

Swedish prosecutors allege that the Grammy-nominated rapper and the two other suspects 'deliberately, together and in agreement' attacked Jafari in central Stockholm on June 30.

The trial will be held in a secure courtroom 'because of the large interest from the media and the public,' the Stockholm court said, noting that no photographing or filming will take place during the proceedings.

Prosecutors alleged in more than 500 pages of court documents that the three suspects beat and kicked Jafari while he was on the ground and that he was hit by parts of or a whole bottle.

Prosecutors also said that Mayers pushed Jafari to the ground and the court documents include numerous photos of Jafari's cuts, bruises and blood-stained clothes.