As President Donald Trump prepared in recent weeks to meet in person with Taliban negotiators at Camp David and with Iranian President Hassan Rouhani in New York later this month, National Security Advisor John Bolton grew increasingly frustrated. And on Monday, during a conversation between Bolton and the President, the two men reached their limit with one another.

In his 520 days as Trump’s third National Security Advisor, Bolton, a life-long hawk, had tried to steer the President toward a hard-line foreign policy. As Trump embraced the idea of meeting with two of America’s most ardent adversaries, Bolton objected increasingly vocally, according to several administration sources familiar with their discussions.

Then on Monday, Trump and Bolton spoke to try to clear the air. Bolton brought up the fact that he was left out of a meeting on the Afghanistan negotiations, a U.S. official who was briefed on the conversation tells TIME. As the discussion progressed, it began to spiral outward into Bolton’s broader questions about Trump’s willingness to meet with Iran’s president. “It was supposed to be a very, very limited,” discussion, the U.S. official says, “About how Bolton had been left out of a meeting on Afghanistan and it became a ‘Why are you meeting with Rouhani?'” conversation instead.

The two men offer different accounts of how things went from there. On Tuesday, Trump tweeted that he had asked for Bolton’s resignation on Monday evening, and had received it Tuesday morning. “I informed John Bolton last night that his services are no longer needed at the White House,” Trump wrote. Bolton later tweeted that it was he who had offered to resign Monday evening, and that Trump had accepted Tuesday morning.

Either way, Bolton’s departure represents a turning point for the Trump presidency. A blunt, famously effective bureaucratic knife fighter, Bolton had sometimes succeeded in steering Trump towards a tougher line in some parts of the world, including against Iran. Since joining the White House in April 2018, Bolton did away with much of the National Security Council deliberation processes and, in a break with his camera-shy predecessors, stepped into an outsized public role. He used his Twitter account to issue dire warnings in order to keep the America’s adversaries off-balance. In several instances, Bolton threatened Venezuela’s President Nicolas Maduro with imprisonment or worse unless he abandoned power. He issued formal written statements on military posture, most notably on May 5 when he announced the movement of U.S. forces the Middle East “to send a clear and unmistakable message to the Iranian regime.”

Bolton, a former Fox News analyst, also found ways to insert himself into the 24/7 Washington news cycle. He rattled North Korean leader Kim Jong Un in June 2018 by suggesting his regime should follow the “Libya model” of nuclear disarmament. It was an unsubtle reference from Bolton, who has long opposed diplomacy with Pyongyang, knowing that Kim wasn’t eager to follow the path of Libyan dictator Muammar Gaddafi, who abandoned a nuclear program only to be toppled from power by Western military forces and executed nearly eight years later.

Now, with foreign-policy challenges simmering from the Middle East to the Korean peninsula to South America, the President’s national-security operation has lost one of its most powerful players.

“John got caught in the middle of the President’s bipolar foreign policy instincts,” says a senior U.S. official familiar with the relationship between the two men. On one hand, Bolton’s willingness to consider using military power to solve problems like Iran and North Korea appealed to Trump’s desire to be seen as a tough guy, the official says. “But Trump’s deal-making instincts have won out,” the official continued, speaking on the condition of anonymity because he was not authorized to discuss internal administration deliberations.

From the start, the two were never well-suited on a personal level, says a U.S. intelligence official who attended meetings that included both men. Bolton had taken over from the stiff, process-oriented General H. R. McMaster, who had in turn taken the reins from Trump’s ill-fated first NSC chief, Michael Flynn. Bolton was less inclined than either to be deferential. “Bolton was an ideologue who sought to advance a world view,” says David Rothkopf, author of Running the World: The Inside Story of the National Security Council and the Architects of American Power. “Whereas Trump is a Trumpist—all about himself all the time, and very impulsive. It was a marriage that was doomed before the vows were spoken.”

The fact that the two men never clicked personally made Bolton’s influence during his time as National Security Advisor all the more remarkable. Bolton was most powerful when he was working issues that Trump wasn’t invested in or paying much attention to. Bolton, along with the allies he placed throughout the State Department and national-security establishment, was able to run U.S. policy on Venezuela, bringing U.S. sanctions and international pressure to bear against Maduro.

But over time, Trump grew to trust Secretary of State Mike Pompeo over Bolton. “The breach between Bolton and Pompeo kept growing, and Pompeo and his team took advantage of that, promoting the reports that Bolton’s star was falling,” the senior U.S. official said. “Bolton thought Pompeo’s top priority was not getting crosswise with the President because that might hurt his political ambitions.”

Pompeo allies were relieved to see Bolton go. Bolton had been “undermining the president constantly,” on both his outreach to North Korea and to the Taliban, a senior administration official in Pompeo’s camp says. Seeing an opportunity to sideline his opponent, Pompeo increasingly cut him out of the details of ongoing Afghan negotiations.

At the same time, Pompeo worked to coordinated interagency cooperation with the newly-confirmed Defense Secretary Mark Esper, a long-time Pompeo ally, and CIA chief Gina Haspel, Pompeo’s former deputy, the official added.

By the end, Bolton had reached his limit. “Bolton was screaming about the Taliban meeting,” says a national-security expert with close ties to White House officials. Bolton thought a meeting on U.S. soil would legitimize the Taliban and considered it tone deaf to schedule the summit so close to the anniversary of the Sept. 11, 2001 attacks. The meeting was Trump’s idea, and he bristled that Bolton objected to it internally, this expert and other officials say.

Trump had already tired of Bolton’s hard-line ideas on Iran and Bolton’s internal revulsion to Trump’s stated willingness to meet with Rouhani, the expert says. While the Taliban Camp David meeting collapsed, Trump remains open to meeting Rouhani in New York later this month, and preliminary planning is already underway in case such a meeting comes through, according to a U.S. official familiar with the discussions.

Ultimately, Trump began to feel that Bolton was too far out of step with his instinct to meet with Iranian leaders, the official said. Internally, Bolton was ready to acquiesce to the meeting, but insisted that sanctions should continue to ramp up. As recently as Sept. 4, Bolton tweeted about new actions to block Iran’s oil shipments that generate cash for the Iranian Revolutionary Guard Corps and Iran’s support for armed proxy groups in the Middle East, according to a U.S. official familiar with the discussions.

Trump critics see the development as another sign of disorder in the President’s foreign-policy operation. “Protecting our country is about more than egos and who will deliver splashy summits,” says Brett Bruen, a former NSC official for President Barack Obama. “We desperately lack stability and strategy in our national security. This is dangerous and destabilizing for the United States and our allies, as our adversaries are able to exploit the constant trouble, turbulence, and transitions of this administration.

“While I may not agree with John on much, he attempted to apply a discipline and consistency to Trump’s erratic foreign policy moves,” Bruen says. “It is likely we will see a return to even greater extemporaneous diplomacy. While certainly more radical than most National Security Advisors, world leaders felt like he represented more of a rational actor than Pompeo’s sycophantic style. They will sorely miss him, as he was what counts for a brake on some of Trump’s more dangerous tendencies.”

That point underscores one consistent truth about the Trump presidency, agreed upon by critics and allies alike. Asked where Bolton’s departure leaves U.S. foreign policy, officials who spoke to TIME under the condition of anonymity had the same answer: where it’s always been, in Trump’s hands.

-With reporting by Tessa Berenson, Vera Bergengruen, Kim Dozier, W.J. Hennigan and John Walcott

Contact us at letters@time.com.