STOCKHOLM — Rapper ASAP Rocky told a Swedish court Thursday that he tried to handle a dispute peacefully, saying he tried to reason with two men who had confronted him, before a brawl erupted leading to his arrest.

"We pleaded and we begged and we said, 'Look man, we don't want to fight y'all. We don't want any more problems. We don't want to go to jail. We don't want to fight y'all. Please stop following us,'" he said during his testimony.

Rocky had headlined Smash x Stadion, a two-day hip-hop festival in the country's capital, before being involved in an alleged street fight. He was arrested July 3 on allegations that he and two members of his entourage attacked Mustafa Jafari, 19.

The performer, whose real name is Rakim Mayers, has pleaded not guilty to the charges.

While being questioned by lawyers Thursday, the rapper said he and his crew were out sightseeing in the Swedish capital when they were approached by the two men who wouldn't leave them alone, prompting his security guard to push one of them away.

"I couldn't help but assume that these guys were affected by some kind of drug," he said.

The crew tried to walk away and picked up bottles lying on the ground with the intention of keeping them away from their assailants, he said. They also tried to call an Uber but it didn't work.

The men became more aggressive, attacking a security guard, which is when Mayers said he got involved in the physical dispute. They didn't call police, he said, because they didn't know the number to call in Sweden and simply wanted to escape to the hotel as quickly as possible.

Authorities have said one person was beaten and cut with broken bottles in the June 30 scuffle. One bodyguard was released without charge soon after Mayers and two of his associates were arrested.

Before his arrest, videos posted to the rapper's Instagram account show him and members of his entourage arguing with two men on the street, telling the men to stop following the performer.

In Wednesday's hearing, prosecutor Daniel Suneson showed the judge video from security cameras and witnesses' phones, which he said supported the case against the defendants. He claimed the victim, Jafari, was kicked and punched before being hit over the back with a bottle. The defense says there is no evidence of this.

The two-time Grammy nominee has remained in custody for the weeks between his arrest and the trial because he was deemed a flight risk. His lawyer, Slobodan Jovicic, called the ruling to detain him "unjust."

He has had to cancel several shows in his European tour as a result.

The case has attracted global attention with celebrities including reality television star Kim Kardashian West and musician Rod Stewart demanding his release, claiming he has been treated unfairly because he is black. President Donald Trump also weighed in, asking Sweden to reconsider the detention order.

Among those present in court Tuesday when the trial kicked off was U.S. diplomat, Robert C. O'Brien, who is the State Department's special presidential envoy for hostage affairs.

Sweden's Prime Minister Stefan Löfven had responded to Trump's calls saying it wasn't his place to interfere with the judicial system and Rocky wouldn't be given special treatment.

Witnesses, along with both the accused and Jafari are expected to be questioned in court Thursday. Closing statements in the case could be made as early as Friday.

Alex Ponomarev reported from Stockholm, and Linda Givetash reported from London.