US President Donald Trump has announced he fired his hard-line national security adviser, John Bolton, saying he disagreed "strongly" with him.
"I asked John for his resignation, which was given to me this morning," Mr. Trump tweeted, adding he would appoint a replacement next week.
But Mr. Bolton insisted he had quit and vowed to have his say "in due course".
He had disagreed with the president on a number of foreign policy challenges, from Afghanistan to Iran.
Mr. Bolton, who had served since April 2018, was Mr. Trump's third national security adviser after Michael Flynn and HR McMaster.
What is Bolton saying?
Moments after Mr. Trump's tweet, Mr. Bolton took to Twitter to offer a different version of events.
He maintained he had actually offered his resignation but Mr. Trump told him, "Let's talk about it tomorrow."
As the news broke, Mr. Bolton texted a Fox News host live on TV to insist he had resigned as national security adviser.
He also texted Washington Post reporter Robert Costa to say, "I will have my say in due course" and "My sole concern is US national security".
The dismissal came as a surprise. Just two hours before his departure was announced, Mr. Bolton had been due to host a White House briefing with Secretary of State Mike Pompeo and Treasury Secretary Steven Mnuchin.
The new acting national security adviser will be Charles Kupperman, who was a deputy to Mr. Bolton, the White House told the BBC.
What are White House sources saying?
Sources said the National Security Council, which advises the president, had become a separate entity within the White House under Mr Bolton.
A former senior Trump administration official, who wished to remain anonymous, told the BBC: "He [Bolton] operates separately from the rest of the White House."
According to the official, Mr Bolton did not attend meetings and followed his own initiatives.
A White House official told the BBC's US partner, CBS News, "Bolton has his priorities. He didn't ask the president 'What are your priorities?' They're Bolton's priorities."
A former senior administration official told CBS Mr Bolton's "his way or the highway" approach had infuriated many people inside the White House, including the president.
In the lead-up to Mr Bolton's firing, Mr Trump reportedly approached his predecessor, HR McMaster, NBC News reports.
The president told the retired general he missed him and asked his advice on national security issues, two anonymous sources familiar with the conversations told NBC.