While it is unquestionable that Barack Obama made the war in Afghanistan “his” war, it also is true that it was served to him on a platter and with a gun pressed against his back.

It was in fact the Pentagon’s chosen war. Had he refused to fight it, Pentagon insider stories, the opposition press and the Republican Party would have attacked him and his new administration for demonstrating incompetence in dealing with world affairs, naive and pacifist inclinations, and a willingness to “surrender” to terrorism.

Mr. Obama, a presidential candidate wholly without military experience, decided to forestall the inevitable attacks upon him as someone incapable of dealing with security issues, by accompanying his promise to end George W. Bush’s Iraq war and making peace in Iraq (yet to be accomplished — as was foreseeable at the time) by relaunching and winning “the right war,” the war in Afghanistan against al-Qaida and the Taliban.

This was a half-baked notion since al-Qaida’s survival as a serious terrorist organization, rather than an internationally notorious franchise for homegrown terrorism, was at the time doubted, and the Taliban was clearly a domestic Afghan political and social phenomenon possessing no international dimension other than in neighboring Pakistan. It had neither the design nor the capability to attack the United States or Europe — nor any interest in doing so.

The Taliban had done nothing directly to harm the United States, but those in the United States who, for various reasons, wanted the war in Afghanistan prosecuted by Washington, held that unless the U.S. defeated the Taliban and controlled Afghanistan, that country would be forever a “safe haven” for terrorism. Much the same thing could be said of most of the world’s unoccupied spaces (including Utah and Idaho).

The ascendant force in the Pentagon when Obama took office was a group of younger officers associated with Gen. David Petraeus, author of a restatement of classical political as well as military anti-insurgent tactics in a forthcoming U.S. Army Field Manual. He had been named commandant of Central Command (covering the Middle East and Central Asia) by Secretary of Defense Robert Gates, and in turn placed a protege, Gen. Stanley McChrystal, in command in Afghanistan. Petraeus was credited with what actually was not (and still is not) “victory” in Iraq because he had recommended and commanded the “surge” of reinforcements sent into Iraq in 2007-08, and was associated with the program that had recruited and paid Sunni tribal forces to restore order in their own tribal areas by driving out al-Qaida’s supporters (tacitly in support of the dominant Shiite political forces in Baghdad, expected to win the forthcoming 2010 parliamentary elections and form an independent coalition government — which has yet to happen).

The new President Obama sent Gen. McChrystal to Kabul to assess the situation and recommend a program of action. To no one’s surprise, he recommended a “surge” of troops to Afghanistan, as in Iraq, to a total that today already is at nearly 100,000 American soldiers and contractors, plus a huge program of civilian “nation builders” in which Americans would go into villages to teach and promote democracy, school-building, women’s education and modern administration. This would follow an initial phase in which American forces would “clear” an area of Taliban and would then install newly trained Afghan soldiers and police to secure or “hold” the newly liberated area while NATO combat forces would move ahead to clear still more of Afghanistan.

Afghanistan is a country of some 250,000 square miles (646,000 square kilometers). It is larger than France, most of it rugged and very difficult to access. Its population is estimated by the U.N. to be some 30 million, 80 percent of it rural and tribal, a society profoundly disrupted by virtually continuous war since 1979, and mostly illiterate.

President Obama asked Gens. McChrystal and Petraeus how long their program would take. They assured him that American troops could begin shipping home in a year, and so the president assured the American people.

It is difficult to imagine how Gens. McChrystal and Petraeus could in good faith have presented him with so fantastical a plan, or how Barack Obama, who is surely not a fool, could have accepted it. But the press, the Congress and the American people nodded collectively that this was a scheme of benevolent nation-building that could transform and pacify Afghanistan. Former Secretary of State Condoleezza Rice had written a few months before in Foreign Affairs magazine that the United States could and should “change the world, and in [America’s] image.” To do so, she wrote, was “a uniquely American realism.”

Such fantasy is bipartisan. It can by no means simply be blamed on Obama and the Democrats. It is as American as apple pie, and Gens. McChrystal and Petraeus’s strategy for pacifying Afghanistan came straight, freshly baked, out of the Pentagon.

Today the fantasy has collapsed. The accounts of journalists and of soldiers themselves, the small-unit combat histories newly disclosed in the WikiLeaks classified documents, have made plain what every informed grown-up American should have known from the beginning, that U.S. forces are being defeated in this preposterous effort, just as Soviet and British imperial forces were defeated before them.

Barack Obama might today call in Gen. Petraeus, and his predecessor Gen. McChrystal, together with the latter’s “Team America” of high school jocks, and tell them that as they are responsible for this fiasco of destruction and useless slaughter, they will now make a public apology to the American people, and take charge of executing a mass American retreat from Afghanistan, with as little loss as possible to American forces and the Afghan people.

There is nothing to be gained by staying.

But that is impossible. Failure is merely a steppingstone to success in the American military and political systems. No one accepts responsibility. The war will go on until it is extended to Pakistan, and possibly beyond. Casualties will steadily mount. No one can predict when the inevitable moment will come, but it will come, when the last Americans are lifted by helicopter off an embassy rooftop, and the Afghans, Pakistanis, Indians, Tajiks and others at last are left to reconstruct their own world.