There is movement toward peace in Afghanistan — or at least toward an end to the American military ordeal there, which has lasted for almost 18 years.

U.S. officials and representatives of the Taliban insurgents have held seven rounds of direct talks in the tiny gulf state of Qatar since last October, and they are getting close to a deal. During a visit to Afghanistan last month, U.S. Secretary of State Mike Pompeo said the Trump administration hoped for “a peace deal before Sept. 1.”

This prospect is not getting much attention because everybody is worried that Trump is about to blunder his way into a new and much bigger war with next-door Iran, but it really could happen. American troops could all be gone from Afghanistan 18 months from now.

The real question is: How long after that will the Taliban be back in power?

When a great power loses a war with a much weaker enemy in a very much poorer country, it can’t actually admit defeat. That’s just too humiliating. So the local victors often have to let the great-power loser save face by giving it a “decent interval” (in Henry Kissinger’s deathless phrase) after the great power’s troops pull out before they collect their winnings.

How long is a “decent interval”? Generally around three years. That’s how long North Vietnam waited after U.S. troops left South Vietnam (1972) before overrunning the South (1975). It’s how long it took after Russian troops left Afghanistan (1989) before their puppet government in Kabul was destroyed (1992) — although a civil war between rival Islamist groups prevented the Taliban from occupying the capital until four years later.

And it’s probably about how long the Taliban will have to wait after U.S. troops leave Afghanistan this time (say late 2020, just before the U.S. election), before they are formally back in power in Kabul. (Say, 2023?)

There’s still a lot of killing going on in Afghanistan — about 20 civilians killed or wounded on the average day, at least twice that number of government troops, and large numbers of Taliban, too — but the Taliban have won.

Even with huge U.S. air support, the more-or-less elected government the United States created in Kabul has lost control of one-third of Afghanistan since American and other Western troops pulled out of ground combat roles in 2014. Another third of the country is government-controlled by day, Taliban-run at night.

If the remaining 14,000 U.S. troops and their associated air power leave, it’s game over for President Ashraf Ghani’s “puppet” government (as the Taliban call it). The U.S. implicitly recognizes this reality, because it’s only American diplomats, not official Afghan government representatives, who are negotiating with the Taliban in Qatar.

A few Afghan officials were allowed to be present at the last round of the Qatar peace talks “in a personal capacity,” but they weren’t negotiating anything. Ghani’s government will have to accept whatever deal the United States makes, knowing perfectly well they’re being abandoned. After that they will have no options left except to steal as much as they can, and then get out before the roof falls in.

And how will the White House justify selling out its Afghan allies and dependents to itself? Without any great difficulty, if the Nixon Tapes are any guide.

The key conversation between President Richard Nixon and his national security adviser, Henry Kissinger, in August 1972, when they were deciding to bail on South Vietnam, was recorded on the White House system and subsequently made public during the Watergate scandal.

Nixon: “Can we have a viable foreign policy if a year from now or two years from now, North Vietnam gobbles up South Vietnam? That’s the real question.”

Kissinger: “(Yes), if it looks as if it’s the result of South Vietnamese incompetence. If we now sell out in such a way that, say, within a three- to four-month period, we have pushed (them) over the brink ... it won’t help us all that much.

“So we’ve got to find some formula that holds the thing together a year or two ... after which — after a year, Mr. President, Vietnam will be a backwater. If we settle it, say, this October, by January ’74 no one will give a damn.”

It worked for Nixon and Kissinger, and it can work for Trump and Pompeo, too. They may not be as clever or as cunning, but they are just as ruthless. The pull-out won’t come back to bite them politically, either, because the Taliban were never interested in attacking the United States. (That was al-Qaida.)

The only losers in the settlement will be the Afghans, who have to live under Taliban rule again. But that was always going to happen in the end.

Gwynne Dyer is an independent journalist based in London.