He was appointed the special presidential envoy for hostage affairs under Mr. Trump and worked to release Americans held abroad. Among those who have been freed are Andrew Brunson, a pastor held by Turkey for two years, and Danny Burch, an oil-company engineer kidnapped in Yemen and rescued in a raid by forces from the United Arab Emirates.Mr. Trump has often celebrated these releases with meetings in the Oval Office, where Mr. O’Brien praised the president lavishly.“This wouldn’t happen with all of these hostages and detainees without the support of the president,” Mr. O’Brien said in March after Mr. Burch’s release. “The president has had unparalleled success in bringing Americans home without paying concessions, without prisoner exchanges, but through force of will and the good will that he’s generated around the world.”Mr. Trump has often cited that praise, even taking it another step. “‘President Donald J. Trump is the greatest hostage negotiator that I know of in the history of the United States. 20 hostages, many in impossible circumstances, have been released in last two years. No money was paid,’” he wrote on Twitter in April, citing Mr. O’Brien.More recently, Mr. Trump sent Mr. O’Brien to Sweden for an unusual mission of trying to win the release of the rap star ASAP Rocky, who had been arrested on charges of criminal assault. A Swedish judge released the rapper pending a resolution of the case and a court later found him guilty; he was ordered to pay damages but did not have to spend more time behind bars.Mr. O’Brien had a successful meeting with the president and with the acting White House chief of staff on Friday, according to a person familiar with the events. Mr. Trump has been taken with Mr. O’Brien’s looks and demeanor, thinking he “looks the part,” as one person close to the president said.Mr. O’Brien is not well known personally to the president, but he has seen him in the Oval Office at different events. He also liked the role that Mr. O’Brien has played, including in the ASAP Rocky case.