U.S. rapper A$AP Rocky on Tuesday pleaded not guilty to an assault charge on the first day of a trial in Sweden that has drawn international attention and prompted U.S. President Donald Trump to intervene on the artist's behalf.

The 30-year-old performer, producer and model, whose real name is Rakim Mayers, was detained on July 3 in connection with a street brawl in Stockholm in the early hours of June 30. He's been charged with assault causing actual bodily harm.

Mayers's lawyer said his client, sitting next to him in prison clothes of a green T-shirt and trousers, pleaded not guilty and had acted in self-defence.

Both Mayers and the plaintiff, a 19-year-old man, will face cross-examination later on Tuesday.

Mayers has said the plaintiff provoked him and two companions who have also been charged with assault. If convicted at Stockholm district court, they could face up to two years in jail.

Trump comments unheeded

His detention before his trial has prompted angry responses from fans as well as from several artists and other celebrities ranging from Kim Kardashian to rocker Rod Stewart.

Trump had asked Swedish Prime Minister Stefan Lofven to help free Mayers, and later tweeted messages saying he was "very disappointed" in Lofven, demanding: "Treat Americans fairly!"

A$AP Rocky, seen in 2018, has claimed the accuser provoked him and members of his entourage. (Nicholas Hunt/Getty Images)

Trump had said he would personally vouch for Mayers's bail. Sweden does not have a bail system.

Lofven has said he will not influence the rapper's case. Sweden's judiciary is independent of the political system.

Mayers, best known for his song Praise the Lord, was in Stockholm for a concert. He has had to cancel several scheduled shows across Europe due to his detention.

Posters asking for A$AP Rocky to be freed line the wall across from the jail where the American rapper is being held over charges of assault are shown in Stockholm. (Philip O'Connor/Reuters)

Before his arrest, Mayers uploaded videos on Instagram of the moments before the alleged assault, saying two men were following his team and he did not want any trouble.

Mayers shot to fame with his 2011 debut Live.Love.A$AP. His latest album, Testing, reached the No. 4 spot on the Billboard 200 charts on its release last year.