Image copyright Getty Images Image caption President Donald Trump and new national security adviser Robert O'Brien

US President Donald Trump has named a new national security adviser to replace John Bolton.

Robert O'Brien has had a long career in foreign policy working for both main US parties and currently heads hostage negotiations at the State Department.

He is Mr Trump's fourth national security adviser.

As top adviser on national security, Mr O'Brien will be tasked with tackling everything from immigration policy to heightened tensions with Iran.

The president and his new appointee spoke with reporters on Wednesday morning in Los Angeles.

"Robert has been fantastic," Mr Trump said, praising Mr O'Brien's work with hostages. "We know each other well."

Mr O'Brien said it was a "privilege" to take on the role.

"We've got a number of challenges but there's a great team in place," he said. "I look forward to working with them and working with the president to keep America safe and continue to rebuild our military."

Mr O'Brien follows Mr Bolton, HR McMaster and Michael Flynn in the role, which does not require confirmation by Congress.

Who is Robert O'Brien?

The new national security adviser trained as a lawyer then went on to advise Republicans on foreign policy and has served in various government roles.

Image copyright Getty Images Image caption Robert O'Brien has had a long diplomatic career working for both Republicans and Democrats

Former President Bush appointed him in 2005 to serve as a representative to the UN General Assembly.

While at the UN, he worked with Mr Bolton, who was then the ambassador. He has also worked for former secretaries of state Condoleezza Rice and Hillary Clinton.

A former Obama administration official was among those who celebrated the appointment of Mr O'Brien.

"All I have to say is that @robertcobrien is a really, really good person and that I wish him all the best in what will certainly be a challenging role," said Andrew Exum, a former deputy assistant secretary of defence for Middle East policy, on Twitter.

The new Trump pick and his predecessor share some similar views.

Mr O'Brien was critical of the UN in his book, While America Slept: Restoring American Leadership to a World in Crisis.

He wrote that his son described the general assembly as "when all the dictators come to America and give speeches about how bad we are", something Mr O'Brien called "one of the better descriptions" he had heard.

Mr O'Brien has also criticised the Iran nuclear deal, calling Iran "the largest state sponsor of terrorism in the world".

Media playback is unsupported on your device Media caption Speaking in April 2019, Robert O'Brien addresses families of Americans held captive abroad

In his role as special presidential envoy for hostage affairs, Mr O'Brien works with families of US hostages and advises on related issues, including recovery policies.

Mr O'Brien was involved with the release of US rapper ASAP Rocky from Swedish detention last month.

He is believed to be the highest-ranking Mormon member of the Trump administration.

What happened to John Bolton?

Mr Bolton, a foreign policy hard-liner, was ousted after repeated clashes with the president and other members of the administration, particularly regarding North Korea and Venezuela.

Mr Trump tweeted on 10 September that he had asked Mr Bolton for his resignation because he "disagreed strongly with many of his suggestions".

Moments after the president's announcement, Mr Bolton said that actually he had offered to resign, and Mr Trump said they would "talk about it".

Sources said the National Security Council, which advises the president, had become a separate entity within the White House under Mr Bolton and many within the White House criticised Mr Bolton's approach.

From rabble-rouser to conventional choice

After more than a year of having a political and ideological lightning rod as national security adviser, Donald Trump went with a much more conventional choice.

Where outgoing NSA John Bolton was bombastic - an outside personality with an eye for the television cameras - Robert O'Brien is a behind-the-scenes bureaucratic player. He spent much of his career practising law, and when he did make forays into public service, it was mostly in roles deep in the machinery of government.

Mr O'Brien, a civilian, also stands in contrast to the two former generals that the president has chosen for the position, Michael Flynn and HR McMaster. His selection could be an indication that Mr Trump is losing his early affinity for military brass.

Given that O'Brien was a foreign policy adviser for the Mitt Romney and Scott Walker's presidential campaigns and worked in the George W Bush administration, Mr Trump's move could also help repair strained relations with the conservative foreign policy establishment.

Mr O'Brien takes this top national security position as multiple global disputes teeter on the brink of full-blown crisis. He will work for a commander-in-chief who prides himself on his unpredictability. The task ahead is daunting.

What are the immediate challenges he faces?

Mr O'Brien takes up the role with the administration on the brink of a full-blown crisis with Iran following attacks on Saudi Arabian oil facilities.

The US blames Iran for the attacks but Iran has denied any involvement. Secretary of State Mike Pompeo held discussions in Saudi Arabia on Wednesday to explore possible responses.

Mr O'Brien will also need to work with the president on a strategy for persuading North Korea to give up its nuclear weapons.

Mr Trump and North Korean leader Kim Jong-un have met three times but tangible signs of progress have been scant.

Then there is Afghanistan. This month the US and the Taliban appeared close to a deal to end the long-running conflict but Mr Trump abruptly cancelled a planned meeting following the death of a US soldier in an attack by the insurgents.

One of the Taliban's chief negotiators told the BBC their "doors are open" and that negotiation is "the only way for peace in Afghanistan".