Donald Trump on Tuesday announced that he asked his national security adviser John Bolton to resign.
In a tweet on Tuesday, Mr Trump said he "disagreed strongly with many of his suggestions, as did others in the administration", but thanked him for his service.
Mr Bolton tweeted back, disputing Mr Trump's version of events.
"I offered to resign last night and President Trump said, 'Let's talk about it tomorrow'," he wrote.
Mr Bolton’s ousting came as a surprise to many in the White House.
Only an hour before Mr Trump’s tweet, it was announced that Mr Bolton would join Secretary of State Mike Pompeo and Treasury Secretary Steven Mnuchin in a briefing on new sanctions.
He took the position in April 2018 and clashed with Mr Trump on policy issues, most recently peace talks with the Taliban and direct talks with Iran.
Mr Bolton's firing was met with dismay among some Republicans in Congress.
"I'm very, very unhappy to hear that he is leaving," Mr Romney told The New York Times. "It's a huge loss for the administration and for the nation."
Senator Lindsey Graham could not offer an explanation.
”I think the view that there’s some public discussions about Bolton being on the other side of meeting with the Taliban probably was a bridge too far," Mr Graham told CNN. "I don’t know what happened there."
Experts saw his exit as a sign that Mr Trump wanted to engage with Iran.
"It's a big sign that Mr Trump will chase the diplomatic track going forward with Iran," Ryan Bohl of the intelligence firm Stratfor told The National.
An adviser to Iranian President Hassan Rouhani said that Mr Trump's firing of his national security adviser pointed to the failure of Washington's "maximum pressure strategy" against Iran.
"The marginalisation and subsequent elimination of Bolton is not an accident but a decisive sign of the failure of the US maximum pressure strategy in the face of the constructive resistance of Iran," Hesameddin Ashena tweeted.
Mr Trump again said on Monday that he had "no problem" meeting Mr Rouhani.
If such a meeting were to take place, the UN General Assembly this month would be a likely forum.
Mr Bohl said the resignation would alarm Israeli Prime Minister Benjamin Netanyahu.
“That’s the end of the hawkish influence in this administration for now, since Mr Pompeo is more of a sanctions guy, not a military-option advocate,” he said.
Karen Young, a resident scholar at the American Enterprise Institute, tied the timing of Mr Bolton's firing to the US primaries due to start early next year.
“We are headed into an election cycle where Mr Trump will be focused on short-term foreign policy wins, with little strategic oversight or advice from senior intelligence or defence officials,” Ms Young said.
This approach requires less clarity, she said.
"Mr Bolton has hawkish views but they are well known," Ms Young said. "Now we enter a period of immense foreign policy variability."
She suggested that his replacement could be unqualified and temporary.
Mr Bolton is at least the fifth senior US official to be fired by Mr Trump on Twitter.
The rest are former secretary of state Rex Tillerson, secretary of homeland security Kirstjen Nielsen, secretary of veterans affairs David Shulkin, and FBI director James Comey.
Mr Trump said he would name Mr Bolton's successor next week.