It started with a cordial phone call to the Swedish prime minister. It escalated into a series of tweets that expressed disappointment, first with the prime minister, then with Sweden itself.

Now President Trump’s bid to rescue a rap star, ASAP Rocky, who is being held in a Stockholm jail, has spiraled into a situation the administration has apparently decided requires a diplomat typically used to free hostages from war-torn countries.

But the country in question has not been touched by war in more than 70 years, and Rocky is not a hostage — or, in any case, not by any commonly accepted definition of the term. He is a defendant in a criminal case, accused of assaulting a man on a Stockholm street a month ago.

[ASAP Rocky claims self-defense at his trial.]

Mr. Trump’s special presidential envoy for hostage affairs, Robert C. O’Brien, first appeared on Tuesday in the courtroom in Stockholm, where Rocky and two members of his entourage are standing trial. Mr. O’Brien said in an interview on Tuesday that President Trump had asked him to come to support the defendants.