It was five years ago this month that President Donald Trump's first administration signed a deal with the Taliban that cemented the withdrawal of US-led foreign forces from Afghanistan and the full return to power of the militant group after nearly two decades of insurgent warfare.
I was working in Kabul at the time and had spent the previous year covering the secretive negotiations with a growing sense of astonishment, shared by my Afghan colleagues, as Mr Trump and his special envoy, Zalmay Khalilzad, forged an agreement in Doha that many came to see as a betrayal.
After the US had spent about $2 trillion and lost more than 2,400 troops in Afghanistan, Mr Trump, who prides himself on his deal-making abilities, appeared eager to end the war, regardless of the consequences. His agreement arguably amounted to a total surrender to the Taliban, 19 years after the US-led invasion to remove the militants for harbouring Al Qaeda and its leader Osama bin Laden as they organised the September 11, 2001 attacks.
The US-funded Afghan government was blocked from taking part in the talks and Nato was completely sidelined. The deal glaringly omitted any sort of protection for the many US-backed reforms to Afghan society that had been implemented over the years, such as basic freedoms for women and girls. Yet so pleased was he with the deal that Mr Trump wanted to invite the Taliban to Camp David to sign it – before his advisers convinced him the optics of having former insurgents in the hallowed home of American diplomacy wouldn't be awesome.

The primary concession the US extracted from the Taliban was a commitment they would not allow Afghanistan to become a safe haven for terrorist groups to plot against the West. The Taliban also committed not to shoot at foreign forces as they left. Ending wars is a good thing, but the current state of Afghanistan, where women are once again barred from public life and the country is, by some measures, now the world's poorest, underscores the consequences of sloppy deal-making.
I'm reminded of the US-Taliban deal today as I watch events unfold at breakneck speed in Saudi Arabia, where US Secretary of State Marco Rubio met Russian Foreign Minister Sergey Lavrov to commence talks aimed at ending the war in Ukraine.
Now, as then, it is clear that Mr Trump's primary concern is making a deal, no matter the cost to a hitherto US ally. Most people want the war to end, and he rightly points to the carnage being inflicted in Ukraine and on civilians and combatants, claiming that Russia alone has lost “millions” of troops.
But sustainable peace must include all stakeholders. If Mr Trump genuinely wants to end the conflict, he can't simply pretend that one of the two warring sides doesn't exist. Any negotiations affecting Ukraine's future have to include Kyiv's participation, or else they are destined to fail.
Like the Afghan government before it, Ukraine has now been shut out of talks about its own future. Making matters worse for Kyiv, Mr Trump telegraphed that he is happy to give Russia a lot, even before negotiations began. On Tuesday, he said Ukraine, which was invaded by Russia, had started the war by refusing to make a deal back in 2022.
Moscow comes to the negotiating table with powerful bargaining chips already tossed on the floor: Mr Trump and his Defence Secretary Pete Hegseth have said Ukraine should make territorial concessions and suggested that future membership of Nato is a non-starter. A pre-emptive gift for Russia and talking points that were echoed by Mr Lavrov in Riyadh on Tuesday.
In Afghanistan, the corrupt government led by Ashraf Ghani now seems destined to have failed. Equipment and money that should have gone to Afghan soldiers was siphoned off at every stage of the supply process, leaving a demoralised and ill-equipped force that didn't want to fight the Taliban once the US had left.
But in Ukraine, a more disciplined and (for now, at least) well-equipped army is unlikely to yield to Russia any time soon, especially if Kyiv continues to be excluded from talks.
Ending the war in Ukraine is a noble goal, but in his rush to get it done Mr Trump is undoing everything the US, Europe and Kyiv have worked towards for three years at huge cost. He is refusing to lay the groundwork for a durable peace.
