That is the story in the Middle East. In Iraq Mr Obama withdrew troops in 2011. In Syria he did not act to stop Mr Assad from wholesale killing, even after he used poison gas. But when IS jihadists emerged from the chaos, declared a caliphate in swathes of Iraq and Syria, and began to cut off the heads of their Western prisoners, Mr Obama felt obliged to step back in—desultorily. In Afghanistan Mr Obama is making the same mistake of premature withdrawal. As NATO’s combat operations wound down into a mission to “train, advise and assist”, Mr Obama promised that the last American troops would leave Afghanistan by the end of 2016. The date had no bearing on conditions in Afghanistan but everything to do with when Mr Obama leaves the White House.

What can Mr Obama do? In Afghanistan, rather than pull out the 9,800 remaining American troops, he should reinforce them and make clear that he puts no date on their withdrawal. The rules of engagement must expand so that NATO forces can back Afghan ones. Attack aircraft should support them as needed, not just in extremis. He needs to knock heads together in Kabul, where the “unity” government forged last year between President Ashraf Ghani and his rival, Abdullah Abdullah, is dysfunctional enough to lack a defence minister. This was Mr Obama’s “good war”: he risks losing it.

In Syria Mr Obama’s dithering means his options continually grow harder and riskier. Mr Putin is unabashedly defending a tyrant and deepening the region’s Sunni-Shia divide. America must hold the line that Mr Assad will not remain in power, and set out a vision for what should follow. It needs to do more to protect the mainly Sunni population: create protected havens; impose no-fly zones to stop Mr Assad’s barrel-bombs; and promote a moderate Sunni force. That may well mean staring down Russian jets.