President Donald Trump on Tuesday announced the firing of his hawkish national security advisor John Bolton, saying he disagreed "strongly" with his positions, in the latest upheaval for US foreign policy.

"I asked John for his resignation, which was given to me this morning," Trump announced, saying he would name a replacement next week.

Bolton, who had been due to give a press conference at the White House less than two hours later, denied being fired and insisted instead that he'd resigned.

The news coming days after Trump caused uproar by revealing he was canceling secret talks with Afghanistan's Taliban - stunned Washington.

Bolton is a veteran and controversial figure closely linked to the invasion of Iraq and other aggressive foreign policy decisions. He had been seen as one of the main driving forces in the White House's muscular approach to Iran, Venezuela and other trouble spots.

Famous for his moustache and ever-present yellow legal pad, the hardline former US ambassador to the United Nations had pushed back hard against Trump's dramatic, though so far stumbling attempts to negotiate with the Taliban and North Korea's Chairman Kim Jong Un.

According to US media reports, the president's extraordinary bid - canceled at the last minute - to fly Taliban leaders into the presidential retreat at Camp David last weekend sparked a major row.

Fired or resigned?

As so often in the Trump presidency, the abrupt reshuffle appeared to contain an element of chaos.

Bolton was Trump's third national security advisor and joins a stack of senior officials who have come and gone during the Republican businessman's tumultuous first term in office.

Trump, who has a habit of announcing major news on his personal Twitter account, revealed the sacking at around midday. He said that he'd informed Bolton of his decision Monday night.

The White House press office, however, seemed to have been unaware. It sent out a message announcing that Bolton would shortly be giving a press conference on terrorism issues alongside Secretary of State Mike Pompeo.

Bolton himself disputed Trump's version of events, saying that the president had not fired him in person, as he claimed, late Monday.

"I offered to resign last night and President Trump said, "Let's talk about it tomorrow," Bolton tweeted.

A Fox News television reporter said that he had received a text from Bolton in which he underlined: "Let's be clear, I resigned."

Anti-war camp boost?

Trump came into office promising to extricate the United States from military entanglements. Bolton was often seen as offering a hawkish counterbalance, which Trump would then take into consideration.

"He has strong views on things but that's okay. I actually temper John, which is pretty amazing," Trump said in May.

Rob Malley, president of the International Crisis Group consultancy, said Bolton's departure could realign White House policy on Afghanistan, Iran, North Korea and Venezuela.

Trump "has had two voices whispering in his ears: the one counseling diplomacy and warning against conflict, the other recommending belligerence," he said.

"With Bolton gone, the second voice undeniably has lost its loudest proponent."

Prominent Republican Senator Rand Paul agreed, tweeting: "The President has great instincts on foreign policy and ending our endless wars. He should be served by those who share those view."