Donald Trump has fired his national security adviser, John Bolton, in a pair of tweets in which he laid bare searing internal divisions within his inner circle, saying he had “disagreed strongly” with his top aide.

The departure of such a resolute hawk raises the possibility that Trump’s foreign policy could now make a dovish turn in the run up to next year’s elections, in particular with respect to Iran.

The president’s firing of his third national security adviser in as many years appears to have caught even the White House by surprise. The explosive tweets were posted barely an hour after it was announced that Bolton would be appearing at a press conference alongside the secretaries of state and treasury.

How will John Bolton's dismissal affect US foreign policy? Read more

Bolton himself added to the confusion, commenting minutes after his public dismissal that he had offered to resign on Monday night but that Trump had replied: “Let’s talk about it tomorrow.”

Bolton continued to press his case that he had resigned rather than being fired. He sent out a battery of texts including to Fox News presenters on air as well as the Washington Post, protesting: “I resigned, having offered to do so last night.”

Bolton’s resignation letter was terse in the extreme.

“I hereby resign, effective immediately, as Assistant to the President for National Security Affairs. Thank you for affording me this opportunity to serve our country,” the two-line note said.

Play Video 1:29 'I'm never surprised': Mike Pompeo reacts to John Bolton's firing – video

The sacking-cum-resignation of the lavishly mustachioed Bolton, an ultra-hawk on foreign policy who under George Bush was a key architect of the invasion of Iraq in 2003, brings to a head mounting tensions within Trump’s top team of national security and foreign policy strategists.

His removal had been a long time coming, with Trump making little effort to disguise his dissatisfaction over many months.

According to the New York Times, Bolton had refused to appear on television talk shows on 25 August after the G7 summit in Biarritz so he did not have defend the president’s views on Russia

The two men agreed on some issues, like scrapping multilateral agreements such as the 2015 nuclear deal with Iran and tearing up the Intermediate-Range Nuclear Forces Treaty with Russia.

But Trump’s maverick approach to dealing with tough men and adversaries, in which he has emphasized a willingness to deal directly with America’s traditional enemies, such as Vladimir Putin in Russia, Kim Jong-un in North Korea – and most recently the Taliban in Afghanistan – was increasingly at odds with Bolton’s hardline belief that US military might is right.

Bolton was also reported to have a testy relationship with the US secretary of state, Mike Pompeo. The two officials are said to have been at loggerheads for months to the extent that in recent days they were not speaking other than at official engagements.

“There were definitely places that Ambassador Bolton and I had different views about how we should proceed,” Pompeo said yesterday. Asked if he had been taken unawares by the development, the secretary of state smiled and said: “I’m never surprised.”

Bolton also appears to have alienated Mick Mulvaney, the acting White House chief of staff, for his refusal to promote presidential policies he did not agree with.

“It was in Bolton’s nature to run an imperial NSC [national security council] but he stepped on the toes of too many people,” said Mark Groombridge, who worked for Bolton for a decade. “He got into the crosshairs of Pompeo and Mulvaney, who saw Bolton as a liability for the 2020 election. War on every front was not what Trump ran on.”

Trump was unusually candid about the rift within his own inner team. In the tweets he posted on Tuesday announcing Bolton’s departure he wrote: “I informed John Bolton last night that his services are no longer needed at the White House. I disagreed strongly with many of his suggestions, as did others in the Administration, and therefore I asked John for his resignation, which was given to me this morning.”

Trump said he would announce his pick for his fourth national security adviser next week, and early speculation on candidates pointed to the ambassador to Germany, Richard Grenell, Iran envoy Brian Hook and Robert Blair, an aide to Mulvaney.

An adviser to Iran’s president, Hassan Rouhani, said Bolton’s departure underlined 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.

Bolton’s departure could open the way to fresh diplomacy with Iran. Trump has repeatedly said he is prepared to meet Rouhani, at the urging of France’s president, Emmanuel Macron.

Asked on Tuesday if he could foresee such a meeting at the UN general assembly later this month, Pompeo replied: “Sure.”

Commentators interpreted the news as further evidence of chaos and confusion within Trump’s White House, but there were also loud sighs of relief from those who were delighted to see such a hawkish influence excised from the heart of government.

Trump couldn't build a foreign policy legacy with Bolton the breaker Read more

Elizabeth Warren, a leading contender for the Democratic presidential nomination, agreed, saying: “The American people are better off with John Bolton out of the White House.”

Her rival, Bernie Sanders tweeted: “A symptom of the problem is gone. The root cause of authoritarianism remains.”

The National Iranian American Council, the largest body of US-Iranians, heralded the decision as the best of Trump’s presidency, saying in a statement: “This single move dramatically reduces the chances of a new, catastrophic war in the Middle East.”

In contrast, the Republican senator Lindsey Graham praised Bolton on Twitter for “always pursuing an agenda that not only helps the President but makes America safe”.

Trump appointed Bolton in March 2018, having been impressed by the former US ambassador to the UN’s performances as a commentator on Fox News, where he advocated a first strike on North Korea and pushed for regime change in Tehran.

The tension between such a militaristic stance and Trump’s hesitancy about being drawn into another major conflict broke into public view this summer as Bolton was increasingly pushed into the shadows. The division was plain to see when Trump made a surprise visit in June to meet Kim, without his adviser.

Profile Who is John Bolton? Show Hide In March 2018 John Bolton, a longtime foreign policy hawk, was named as Trump’s third national security adviser in just 14 months. Over a three-decade career in foreign policy, he has advocated frequent use of military force and disdained diplomacy and international institutions. Before joining the Trump administration, he was best known for a brief stint as president George W Bush’s ambassador to the United Nations – a body he openly sneered at. His role came to an end because the Senate would not confirm him. Bolton has called for bombing both North Korea and Iran. Less than a month before his appointment by Trump, he penned a Wall Street Journal op-ed making “the legal case for striking North Korea first". He seems to have played a key role in the collapse of the second Trump summit with Kim Jong-un in February, when he appeared to have drafted a maximalist list of demands for all-or-nothing disarmament that was presented to the North Korean dictator in Hanoi. A year of diplomacy ground to a halt with Kim, who had been expecting a more gradualist approach Bolton was a harsh critic of the Iran nuclear deal, which Trump pulled out of, and went further, advocating military force against the country. A bombing campaign was the only way to stop Iran from acquiring nuclear weapons, he wrote in another op-ed. Bolton has seized the initiative in the fast-moving escalation of tensions with Tehran during 2019, spinning military deployments in the Gulf that were already in the pipeline as confrontational steps against Tehran, and reportedly irritating some in the Pentagon and intelligence agencies by putting a sensationalist spin on intelligence about Iranian military movements. In the standoff in Venezuela, Bolton was again centre stage, making himself the lead US voice for a failed effort at regime change in Venezuela in late April, producing a personal video appeal calling – in vain – on Nicolás Maduro’s top aides to defect. Behind the scenes he has urged a reluctant US Southern Command to come up with ever more aggressive solutions to Maduro’s hold on power. In the past he has also opposed the International Criminal Court in the Hague. As undersecretary of state under George W Bush, he travelled around the world negotiating two-way agreements in which countries pledged not to send US officials to the court. He also forcefully opposed the UN security council referring suspected genocide in the Darfur region of Sudan to the court, though the United States ultimately sat out that vote and the referral went forward. Bolton grew up in a working-class Republican family in Baltimore, and his first political experience was as a volunteer in the doomed 1964 campaign of Barry Goldwater, a staunch conservative from Arizona. He attended Yale University. Unlike many of his fellow students, he fiercely supported the war effort in Vietnam, but not to the point of taking part himself. He avoided the draft by joining the Maryland national guard.

Bolton held senior positions in the administrations of Ronald Reagan and the elder George Bush, and wrote a book summing up his views: Surrender Is Not An Option. He is derided by critics as a warmonger, but defines his own philosophy as “Americanist” – a close cousin to Trump’s “America First” slogan – and is no fan of traditional carrot and stick diplomacy. “I don’t do carrots,” he has said. Trump announced on 10 September 2019 that he had fired Bolton, tweeting that "I disagreed strongly with many of his suggestions, as did others in the Administration". Photograph: REX/Shutterstock/Rex Features

In June Trump came close to ordering airstrikes on Iran in response to the shooting down of a US surveillance drone but stood the mission down at the eleventh hour. That was a blow to Bolton, who had been the keenest advocate of an airstrike.

Over the months Trump began goading Bolton over his hawkish position in front of other officials and even visiting heads of state. According to Axios, he once said in the Oval Office: “John has never seen a war he doesn’t like.”

But the trigger to Tuesday’s changing of the guard appears to have been Afghanistan. Bolton was openly unconvinced by efforts by Trump and Pompeo to do a deal with the Taliban as part of the plan to withdraw US troops from the country.

Trump had been prepared to go as far as to invite Taliban leaders to Camp David just ahead of the 18th anniversary of the 9/11 attacks on New York and Washington. The talks were cancelled at the last minute – but by then the gulf between the president and his aide had become unbridgeable.