Kabul, Afghanistan — Barbed wire is sold by the mile here. No building of any consequence sits unprotected, open to the public. Most insecure of all, as measured by the amount of so-called security barriers deployed around them, are U.S. and European bases and embassies. You can’t even see the American Embassy from the street. Entire city blocks are consumed by allied facilities.

This is after nine years of nation-building. Banks, hotels, and NGO offices also are mini-fortresses. The Serena is a high-walled, well-guarded luxury hotel where many Westerners stay. Unfortunately, not too long ago the Taliban staged a raid there with fighters dressed as Afghan police. They made for the gym and killed several Westerners.

My colleagues and I instead stayed at a low-key British lodge, which was hidden behind two walls. Our driver knew where to turn before being waved through the unmarked gate where our vehicle was checked for bombs.

Roads are strewn with metal barriers, concrete blocks, sandbagged positions, and machine-gun topped trucks and Humvees. Some side streets are entirely closed to locals. Traveling even a short distance can take an hour or more. Kabul is a collection of small islands rather than a unified city.

Armed men are everywhere: Allied troops. Afghan National Police. Private guards. None of this may come as a surprise in a city at war. But this is the capital of a country where the U.S. has been fighting longer than it did in Vietnam or World Wars I and II. The city is more dangerous than when our troops first arrived.

This land is an almost continuous anomaly. It has a reputation as the “Graveyard of Empires,” but only the Afghan istan of the 19th century and latter 20th century warranted that label. Prior to the “Great Game” between Britain and Russia, empires routinely conquered the country. Most conflict came from foreign invaders rather than domestic insurgents.

And for most of the 20th century, Afghanistan was at peace. Its monarchy wasn’t particularly liberal, but there was little instability — until a 1973 coup sparked nearly four decades of war.

About the only surviving symbol of that era is Darul-Aman, the old royal palace, now a fire-ravaged shell. We took in the site. A couple of weeks afterwards a Taliban suicide-bomber hit a NATO convoy on the same road, slaughtering allied troops and Afghan civilians alike.

With its variegated ethnic make-up, Afghanistan looks like a country on the verge of collapse. The Taliban is dominated by ethnic Pashtuns, while Tajiks, Uzbeks, and other groups made up the Northern Alliance, which took the lead in ousting the Taliban in 2001 with American support. Yet despite the demographic fault lines, there’s little obvious sentiment for secession even in distant and safer cities, such as Herat and Mazar‑e Sharif. Afghan nationhood looks surprisingly robust.

What most Afghans crave is federalism. The monarchy survived by ruling only lightly outside of Kabul. But Hamid Karzai wants to do much more.

Afghans and Western expatriates agree that if there was a moment when nation-building had a chance, it was in 2002 and 2003, when the Bush administration was instead planning for Iraq.

George W. Bush succeeded in ousting the Taliban on the cheap. But his administration ignored Pakistani support for the Pashtun-dominated Taliban even as Islamabad sacrificed the foreign “Arab” fighters. Washington never sent sufficient U.S. troops, preferring to rely on corrupt warlords to round up Taliban and al-Qaeda forces. And the Pentagon soon began shifting intelligence assets and other forces to Iraq.

Meanwhile, we seemed to work overtime to make enemies. An American consultant who served in the embassy after the Taliban’s ouster told me of being visited by frustrated village elders seeking the release of people arrested by American forces based on secret intelligence. The problem worsened as the Karzai government expanded its authority. Villagers knew whom to go to in a decentralized tribal society to resolve disputes. Venality was not unknown among local elders, but decisions were predictable and swift.

No longer.

Even more counterproductive have been the Afghan security forces. The Afghan National Police (ANP) is charged with keeping order, but its professional capabilities consistently earn negative reviews. Worse, when you send in the ANP, one Afghan told me, make Taliban.” In some areas the police have set up unofficial checkpoints where they strip travelers of money and cell phones.

The Afghan National Army (ANA) is touted as more professional. But one Afghan told me that the most important reason the ANA is viewed more favorably than the ANP is that soldiers are stationed away from the population. They simply can’t do as much harm as the police.

It’s easy to blame the security forces. But a fish rots from its head, and so it goes in Afghanistan. Praise for the Karzai government is scarce from anyone not on the official payroll. Afghans and foreigners point to corruption, electoral fraud, and pervasive incompetence.

Not every minister is equally culpable, and at the grassroots some Afghans risk their lives to promote economic development. But Hamid Karzai has become the symbol of everything wrong, head of the “political mafia,” as one Afghan put it, while his brothers run the drug and economic mafias. A foreign associate whose friendship with Karzai goes back many years responded carefully when I asked him about such allegations: no Afghan politician, he said, could survive without taking care of his family and friends.

Privately, few U.S. or NATO officials disagree with such assessments. Some even admit that Western aid has turned Kabul into a vampire city. They say that Karzai is the best we can do. Alas, that slogan isn’t particularly effective at convincing Afghans to die for their country.

In fact, there is no shortage of Afghans who want to create a liberal society in the best sense of the word. Some are sophisticated and Westernized; others are simply decent people trying to survive in an indecent environment. Tribal and ethnic backgrounds mean much less in cities, and even most traditionalists are cultural conservatives not violent jihadists. The vast majority of Afghans want peace and a better life. But outsiders can’t give them either one.

The future doesn’t look good. The Karzai government, like so many Western-backed regimes in other embattled societies, survives only at the sufferance of the allies. Yet allied plans suffer from having been developed in a policy vacuum. Western personnel have little contact with Afghans beyond the political class in Kabul or the people they see as servants — drivers, interpreters, cooks. In Kabul top military and diplomatic officials travel in armed convoys between each other’s fortified compounds.

Nevertheless, some Western military officials believe the new anti-insurgency strategy is working. The abundant Western consultants who fill Kabul’s backdoor speakeasies make the same argument. They say that aid coordination and implementation are better. Allied soldiers win any firefight and are able to clear and hold territory. The foundation is being laid for a new governing structure.

Maybe, but operations have not gone as well as expected in Marja and have been delayed in Kandahar. Some of the optimistic consultants I encountered had been temporarily recalled from the latter because of rising violence — so much for their projections.

The more basic problem is the lack of the “government in a box” that is supposed to be dropped into territories liberated by U.S. and allied militaries. Counterinsurgency doctrine presumes a capable local partner. So long as the Karzai regime cannot provide competent governance, Afghans will continue to take up arms against it.

Indeed, a consistent theme from Afghans and even some Americans here is that there are “good” Taliban and “bad” Taliban. A portion of the movement, and especially the leadership, is fighting for power and is backed by its own set of outsiders, both Pakistanis and “Arabs” (such as al-Qaeda). They win few friends and rule by fear.

But many Taliban foot soldiers are more likely to enlist to expel the outsiders seeking to rule. They dislike Hamid Karzai as much as Barack Obama. Even Afghans opposed to Taliban rule view these as “good” Taliban open to compromise.

One U.S. consultant argued that we should look at allied operations from an Afghan perspective. What if outsiders showed up in America and arrested local residents based on undisclosed intelligence and shipped some of them to prisons thousands of miles away? What if these invaders replaced American leaders, changed American traditions, and revolutionized American mores? Finally, what if the foreigners imposed a new government, most notable for its venality, incompetence, and obsequiousness?

Maybe with enough time, the U.S. and its allies could suppress the insurgents and foster local governance in Afghanistan. But Washington doesn’t have much time. For good reason, the American people are unlikely to support another decade of war in Central Asia. What could possibly justify the cost?

Not terrorism. Although U.S. forces did not kill or capture Osama bin Laden, they did oust the terrorist group from Afghanistan and substantially degrade its capabilities. Today what remains of al-Qaeda is more active in Pakistan. Terrorists can find plenty of other potential host territories, including Yemen and Sudan. Who rules Kabul, or other parts of Afghanistan, doesn’t much matter for confronting the problem of terrorism.

Attempting to create an effective central government in Kabul offers no other serious security benefit. Leaving would be ugly — it would be painted as an American defeat. But then, sticking around and leaving later would be worse. Liberal Afghans would face a bleak future on their own: we should let our friends come to the U.S. if they wish. But staying is not worth years more of warfare, thousands more dead Americans, and hundreds of billions more wasted dollars. Nine years in Afghanistan is long enough. It’s time to bring our troops home.