Men look at the remains of their properties at the site of a July 24 suicide attack in Kabul, Afghanistan. Neither the Soviet Union nor the British Empire at the height of its power could overcome Afghan resistance to a foreign military presence; 16 years of US military presence have fared no better. Photo/AP
IN 2010, Barack Obama's vice-president, Joe Biden, vowed the United States would be "totally out" of Afghanistan "come hell or high water, by 2014".
In 2014, Obama said that he would leave about 8000 US troops there after all, and made an agreement with the new Afghan president, Ashraf Ghani, that extended their stay "until the end of 2024 and beyond".
Donald Trump wasn't having any of that. Back in 2013 he tweeted: "Our troops are being killed by the Afghanis we train and we waste billions there. Nonsense! Rebuild the USA."
But it looks like the generals have now got to him with what passes for military wisdom.
On Monday Trump announced that he would be sending more US troops to Afghanistan -- probably around 4000 -- and that they would stay as long as necessary.
He has a clever new strategy, too: "We are not nation-building again. We are killing terrorists." (I bet George W Bush and Barack Obama wish they had thought of that.)
There is a strong temptation at this point to haul out the hoary old line: "The definition of insanity is doing the same thing over and over and expecting different results." Trump is, indeed, proposing to do the same old things again, ostensibly in the hope of achieving different results.
Peak US troop strength in Afghanistan was 100,000 in 2010-11. If that did not deliver victory then, how likely is it that boosting US troop numbers from 8500 to 12,500 will do it now?
Neither the Soviet Union nor the British empire at the height of its power were able to overcome Afghan resistance to a foreign military presence, and we now have 16 years of evidence that the United States cannot do it either.
Both the British and the Russians were able to maintain a military presence in the country as long as they were willing to take the casualties that involved, but in neither case did the regimes they installed long survive their departure. Whatever their merits, those regimes were fatally tainted by their foreign sponsorship.
The United States now finds itself in precisely the same situation. Ashraf Ghani's government is certainly not the worst that Afghanistan has had to endure, but it lacks legitimacy in the eyes of Afghan nationalists because it depends on foreign troops and foreign money.
Since those foreign troops dwindled from 140,000 in 2011 (including non-American troops from a dozen other Western countries) to only 13,400 now, the Afghan government has lost control of about 40 per cent of the country. And the process is accelerating: one-third of that territory was lost in just the past year.
So what would happen if the foreign troops all left and the Taleban became the government again, as they were in 1996-2001? Would the country become a breeding ground for terrorism? Would more plots like the 9/11 attacks be hatched there? Probably not.
Most urban, educated Afghans are terrified of the Taleban's return, of course, but they are a small fraction of the population. And many foreigners see the Taleban as the least bad alternative to the US-backed regime. As Zamir Kabulov, the Russian special envoy to Afghanistan, said in early 2016: "Taleban interests objectively coincide with ours."
What he meant was that the Taleban aren't interested in foreign affairs at all. They do not dream of a world Islamic empire; they just want to run Afghanistan. Indeed, they are the main military rivals to the jihadis of Islamic State and al-Qaeda, who are currently trying to establish a foothold in the country -- and by and large they are winning those little private wars.
But what about 9/11? There is good reason to suspect that Osama bin Laden and his mostly Arab companions of al-Qaeda, then guests of the Taleban, did not warn their hosts before they carried out that atrocity, since it would clearly lead to a US invasion and the overthrow of the Taleban regime.
Obviously, few of these considerations will have occurred to Donald Trump, but does that mean he really thinks he can win in Afghanistan? Not necessarily.
Maybe, like Obama, Trump has simply decided that he doesn't want the inevitable collapse of the Western-backed regime in Afghanistan to happen on his watch. He's just committing enough American troops to the country to kick it down the road a bit.