US President Donald Trump says he is trying to help free rapper ASAP Rocky, who has been held in police custody in Sweden for weeks.

Urged on by the first lady and celebrities including Kanye West and Kim Kardashian West, Mr Trump said he would be calling the prime minister of Sweden.

“I will be calling the very talented Prime Minister of Sweden to see what we can do about helping A$AP Rocky,” Mr Trump tweeted from aboard Air Force One, where he said he had just spoken with Kanye West about Rocky’s situation.

“So many people would like to see this quickly resolved!” Mr Trump said.

Rocky, a platinum-selling, Grammy-nominated artist whose real name is Rakim Mayers, has been behind bars since early this month as Swedish police investigate a fight he was allegedly involved in in Stockholm before appearing at a music festival.

It was not clear who else was involved, but videos published on social media appear to show a person being violently thrown on to the ground by Rocky.

A defence lawyer has said it was self-defence.

The case has earned the attention of a slew of celebrities, including recording artist and producer Sean “Diddy” Combs, singer Justin Bieber, singer Shawn Mendes, actress Jada Pinkett Smith, Kardashian West’s mother, reality star Kris Jenner, singer Nicki Minaj and rapper Post Malone, as well as Kardashian West, who has worked with the Trump administration on criminal justice reform issues.

Sweden Rapper
Slobodan Jovicic, lawyer for rapper ASAP Rocky, talks to the media after the court proceedings (Fredrik Persson/TT News Agency via AP)

One senior administration official said Kardashian West had approached Mr Trump’s son-in-law and senior adviser, Jared Kushner, whom she has worked with closely, to tell him about the situation on behalf of her husband, a supporter of the president’s.

Mr Kushner then briefed Mr Trump, according to the official, who said Mr Trump felt the case was worth looking into, and directed his secretary of state, Mike Pompeo, to try to move Rocky to better holding conditions and see what else could be done.

Kardashian West thanked Mr Trump, Mr Pompeo and Mr Kushner via Twitter, along with “everyone involved with the efforts to Free ASAP Rocky & his two friends”.

“Your commitment to justice reform is so appreciated,” she wrote.

Sweden Rapper
US deputy foreign minister Carl Risch, left, on his way to the custody hearing for ASAP Rocky, in Stockholm (Fredrik Persson/TT via AP)

Mr Trump did not mention Kardashian West or Mr Kushner to reporters in the Oval Office on Friday and said it was his wife who had originally brought the case to his attention.

“She was telling me about, ‘Can you help ASAP Rocky?'” said Mr Trump, who said he had also heard from others.

“Many, many members of the African American community have called me, friends of mine, and said, ‘Could you help?’

“So I personally don’t know ASAP Rocky, but I can tell you that he has tremendous support from the African American community in this country,” he said.

“We’ll be talking to them,” Mr Trump said, referring to Swedish officials. “We’ve already started.”

“We’re working with the State Department, and we hope to get him home soon,” added first lady Melania Trump.

Stockholm’s District Court decided on Friday that Rocky would remain in custody another week to allow police to complete their investigation. They have until July 25.