WASHINGTON (AP) — President Donald Trump on Tuesday abruptly forced out John Bolton, his hawkish national security  adviser, with whom he had strong disagreements on Iran, Afghanistan and a cascade of other global challenges.

The two men offered opposing accounts on Bolton’s less-than-friendly departure, final shots for what had been a fractious relationship almost from the start.

Trump tweeted that he told Bolton Monday night his services were no longer needed at the White House and Bolton submitted his resignation Tuesday morning. Bolton responded in a tweet of his own that he offered to resign Monday “and President Trump said, ‘Let’s talk about it tomorrow.'”

Trump said that he had “disagreed strongly” with many of Bolton’s suggestions as national security adviser, “as did others in the administration.”

The departure comes at a trying moment for the Trump administration on the world stage, weeks ahead of the United Nations General Assembly and as the president faces pressing decisions on a host of foreign policy issues.

As pressure has mounted amid global troubles and signs of an economic slowdown at home, Trump has increasingly favored aides who are willing to defend him on television. Bolton was tentatively booked to appear on a pair of Sunday talk shows in late August but backed out, saying he was not comfortable with some of the administration’s plans, and that drew the president’s ire, according to a White House official not authorized to discuss private conversations

Also, tensions have risen between Bolton and Secretary of State Mike Pompeo over influence in the president’s orbit and how to manage the president’s desire to negotiate with some of the world’s most unsavory actors.

Since joining the administration in the spring of last year, Bolton has espoused skepticism about the president’s whirlwind rapprochement with North Korea and has advocated against Trump’s decision last year to pull U.S. troops out of Syria. He masterminded a quiet campaign inside the administration and with allies abroad to persuade Trump to keep U.S. forces in Syria to counter the remnants of the Islamic State and Iranian influence in the region.

Bolton was also opposed to Trump’s now-scrapped notion to bring Taliban negotiators to Camp David last weekend to try to finalize a peace deal in Afghanistan.

One Republican familiar with the disagreements between Trump and Bolton said the adviser’s opposition to a possible meeting between Trump and Iranian President Hassan Rouhani was a precipitating factor in the dismissal. French President Emmanuel Macron has been trying to broker such a meeting, possibly on the sidelines of the upcoming U.N. General Assembly, in the hope of salvaging the international Iran nuclear deal that Trump withdrew from.

In Tehran, Hesameddin Ashena an adviser to Rouhani said in a tweet that dismissal of Bolton was a result of the “resistance” of Iran, adding that “cornering and omitting Bolton is a strong sign of failure of maximal pressure policy of the U.S.”

Pompeo said Trump has been clear that he is willing to meet with Rouhani “with no preconditions.” Speaking at an unrelated briefing at the White House, Pompeo acknowledged that he had often disagreed with Bolton on issues.

“There were many times that Ambassador Bolton and I disagreed. That’s to be sure,” Pompeo said.

Treasury Secretary Steven Mnuchin, who appeared with Pompeo, said: “The president’s view of the Iraq war and Ambassador Bolton’s was very different.”

Asked if world leaders should expect changes in Trump’s foreign policies going forward, Pompeo replied: “I don’t think any leader around the world should make any assumption that because some one of us departs that President Trump’s foreign policy will change in a material way.”

Bolton and his National Security Council staff were also viewed warily by some in the White House who viewed them as more attuned to their own agendas than the president’s — and some administration aides have accused Bolton’s staff of being behind leaks of information embarrassing to Trump.

Bolton’s ouster came as a surprise to many in the White House. Just an hour before Trump’s tweet, the press office announced that Bolton would join Pompeo and Treasury Secretary Steven Mnuchin in a briefing. A White House official said that Bolton had departed the premises after Trump’s tweet and would no longer appear as scheduled.

In a further sign of acrimonious relationship, a person close to Bolton told reporters that they had been authorized to say one thing — that since Bolton has been national security adviser there have been no “bad deals” on Iran, North Korea, Russia, and Syria. The person, who did not divulge who had given the authorization, was not allowed to discuss the issue by name and spoke only on condition of anonymity.

When asked to respond to the person’s comment, White House press secretary Grisham smiled and told reporters: “I don’t know how to read” it. “Sounds like just somebody trying to protect him,” she added.

Sen. Chris Murphy, D-Conn., said the move was a cause for worry.

“John Bolton was the wrong choice and the silver lining to this instability is that there will be fewer people whispering war chants in the president’s ear,” said Murphy. “But no one of any quality is going to take a job in the nation’s national security cabinet so long as everyone’s head is permanently hovering slightly above the chopping block.”

South Carolina Sen. Lindsey Graham, who was traveling with Trump Monday, said reports of Bolton’s dissent on the Taliban meeting was a “bridge too far” for Trump.

Later, in a statement, Graham, a close ally of Trump’s, said Bolton pursued an agenda that helped the president and protected U.S. national security. But he also said, “President Trump, like every other president, has the right to a national security adviser of his own choosing.”

White House spokesman Hogan Gidley said Charles Kupperman, the deputy national security adviser and a former Reagan administration official and defense contracting executive, would fill Bolton’s role on an acting basis. Trump said he would name a replacement for Bolton next week.

Bolton was named Trump’s third national security adviser in March 2018 after the departure of Army Gen. H.R. McMaster.

Bolton was always an unlikely pick to be Trump’s third national security adviser, with a world view seemingly ill-fit to the president’s isolationist “America First” pronouncements.

He’s championed hawkish foreign policy views dating back to the Reagan administration and became a household name over his vociferous support for the Iraq War as the U.S. ambassador to the U.N. under George W. Bush. Bolton briefly considered running for president in 2016, in part to make the case against the isolationism that Trump would come to embody.

Still, Trump has admired Bolton for years, praising him on Twitter as far back as 2014. Trump has told allies he thinks Bolton is “a killer” on television, where Bolton is a frequent face on Fox News, though the president has voiced some unhappiness about Bolton’s trademark mustache.