President Donald Trump on Wednesday named Robert O’Brien, a State Department official who has specialized in hostage issues, as his new national security adviser.

“I have worked long & hard with Robert," Trump tweeted. "He will do a great job!”

O’Brien will replace John Bolton, whom Trump fired last week after a string of disagreements.

I am pleased to announce that I will name Robert C. O’Brien, currently serving as the very successful Special Presidential Envoy for Hostage Affairs at the State Department, as our new National Security Advisor. I have worked long & hard with Robert. He will do a great job! — Donald J. Trump (@realDonaldTrump) September 18, 2019

O’Brien had been on Trump’s list of finalists, and the president had praised him as recently as Tuesday as “fantastic.”

Trump, speaking to reporters in California with O’Brien at his side later Wednesday, said his administration has “had a tremendous track record with respect to hostages.”

O’Brien, for his part, said “it’s a privilege to serve with the president.”

O’Brien was integrally involved in the release of rapper ASAP Rocky by Swedish authorities last month. The rapper had been detained and charged with assault in connection with a June 30 scuffle between his entourage and a 19-year-old man in Stockholm.

Trump had emerged as a vocal supporter of the rapper in the criminal case.

O'Brien had been present in court in Sweden when the rapper’s trial began and had written to Swedish prosecutors urging them to release him.

Download the NBC News app for breaking news and politics

As a State Department envoy for hostage affairs, O’Brien led American diplomatic efforts on overseas hostage matters, working closely both with families of American hostages and senior government officials, according to his State Department biography.

Previously, O’Brien was the co-chairman of the State Department’s Public-Private Partnership for Justice Reform in Afghanistan, for both the Obama and George W. Bush administrations. He was nominated in 2005 by Bush and confirmed by Senate to serve as a U.S. representative to the United Nations General Assembly.

The position of national security adviser does not require Senate confirmation.

O’Brien replaces Bolton — who had been one of the most hawkish voices in Trump’s inner circle on a number of issues, including Taliban negotiations and China trade talks — and will be Trump's fourth national security adviser. His first, Michael Flynn, was in court for a status hearing last week before his sentencing for lying to U.S. officials. Flynn's successor, Army Lt. Gen. H.R. McMaster, said he was retiring after repeated disagreements with Trump.

Bolton, known as a fierce infighter, had few loyal allies internally. He had clashed with many senior members of the administration at times, including Vice President Mike Pence and Secretary of State Mike Pompeo.

Trump’s announcement comes as his administration deals with a number of international hot spots, including North Korea, Iran, Venezuela and Afghanistan.

The tweet also came just moments after the president vowed to "substantially increase" sanctions on Iran as tensions in the Middle East rise after an attack on a Saudi oil field, and with Secretary of State Mike Pompeo headed to Saudi Arabia to meet with Crown Prince Mohammed bin Salman to discuss the recent attack.

American officials believe the attack originated from Iranian territory and the president tweeted over the weekend that the U.S. was "locked and loaded" in preparation for some sort of retaliatory action.