Image copyright AFP Image caption All US troops should be withdrawn from Afghanistan, says Professor Andrew Bacevich

US President Donald Trump has committed his country to an open-ended war in Afghanistan that is likely to see more troops deployed. Before becoming president, he had on several occasions advocated the withdrawal of US forces.

Many analysts believe Mr Trump made the right decision in changing his mind. But some do not. They argue the costly war is at a stalemate and American troops should come home. Andrew Bacevich, Professor Emeritus of International Relations and History at Boston University, told the BBC why he thinks withdrawal is the best option.

If keeping US troops in Afghanistan could guarantee that our country would not be targeted by further terrorist attacks, I would favour making our longest war longer still.

But the terrorist threat has evolved since 9/11 and keeping US forces in Afghanistan does not "make America safe".

The opposite is true. Occupying countries in the Islamic world exacerbates the threat rather than reduces it.

Donald Trump as a candidate appeared to get that but now as president has reversed course.

He has returned to establishment views held by the generals that advise him. They insist that there is no alternative than to keep doing what we have been doing since 2001. It is an odd argument: that the most powerful country on the planet has no alternative but to persist in failure.

The argument for continuing the war in Afghanistan assumes that Afghans are incapable of managing their own affairs. It also assumes that our presence and our assistance can make Afghanistan governable.

Media playback is unsupported on your device Media caption "We are not nation building again. We are killing terrorists," Trump said

For almost 16 years, we have tested that proposition. No evidence exists to support it, nor is there reason to think that more of the same - that is what Trump is proposing - will produce better results. Certainly half-measures will not work.

One might speculate that a major escalation - a couple of hundred thousand troops, a few trillion dollars, a decade or so of further exertions - might turn things around. But neither the American public nor Congress nor President Trump himself will support any such effort. As the president said on Monday, Americans are weary of this war.

I am not naïve. I have zero expectation that if the US and its allies withdrew that somehow the various factions in Afghanistan would get together and create a stable, liberal democratic order.

However, it is not implausible to consider the possibility of Afghanistan and its neighbours cobbling together arrangements enabling the various factions to more or less co-exist.

Can I guarantee that this would happen? No.

But if you have been pursuing one course of action for a decade and a half and it hasn't worked, maybe it's time to seriously consider alternatives.

Frankly, if Afghans could cease to fight among themselves and refuse to provide sanctuary to terrorist organisations, that would more than satisfy US interests.

Even if the Taliban regained power, would they embrace IS, al-Qaeda or other such entities? The answer is not necessarily. The last time they did they paid a heavy penalty.

The key would be to create incentives encouraging good behaviour on their part. Economic assistance could be offered as a positive incentive. Promising severe punishment - punitive air strikes, for example - in the event of misconduct might also figure.

Professor Barry Posen of MIT has suggested that a US departure from Afghanistan would energise other countries in the region, like Pakistan, Iran, India and Russia, to exert themselves to prevent Afghanistan from becoming a failed state.

I think this is an important perspective. We should not accept President Trump's absolute certainty that if we leave then Afghanistan will become a terrorist haven.

Finally, I would emphasise that the more preoccupied we are with Afghanistan, the less attention we give to far more pressing issues such as climate change and potential instability in East Asia.

The strategically prudent course of action for the US is to acknowledge our failure and leave.