KABUL, Afghanistan — When Al Qaeda’s planes hit the twin towers on Sept. 11, 2001, the world altered for everyone.

But no two countries have been more affected by the shift than the United States and Afghanistan, who are tied together in a war whose outcome, a decade after the initial invasion, is still very much in doubt.

The United States has changed as a result of 9/11; the sense of superpower invulnerability is gone, perhaps forever.

Afghanistan, too, has undergone a change, but a more physical one. The dusty, hardscrabble capital I first saw in 2004 has been spruced up considerably: high-rise buildings of green and blue glass dominate the center of the city. Apartments and houses are sprouting like mushrooms on the outskirts. Shiny new cars clog the streets, and thousands of well-heeled foreigners are pumping millions of dollars into what was once a cash-starved economy.

But that’s not all. There are the thousands of dead in districts around the country, killed by Taliban explosives, caught in crossfire between the insurgents and foreign troops, shot by U.S. Special Forces in night raids or bombed in misdirected airstrikes.

The Taliban control large swaths of territory, and formerly safe provinces like Parwan and Baghlan are now largely no-go areas. The gains that NATO has made in clearing aside the Taliban are too frequently pushed back as soon as the troops move on.

Most Afghans consider security to be their number-one problem. If travel, school, and work are impossible, not much else matters.

In those first heady days after the fall of the Taliban, anything seemed possible.

Many people initially welcomed the foreign troops. The brutal, joyless Taliban regime was gone. Children could fly kites, teenagers could play music. Chess was once again a beloved pastime, and women began to venture out of their homes on their own.

The sewers were blocked with hair as men lined up at barbershops to shave the long beards required by the Taliban.

“Everyone had two-toned faces,” said Nasim, a young doctor who was just 19 when the Taliban fell. He laughed. “They were all tanned from their noses up, but their chins were pale from being covered with hair for so long.”

I arrived at the height of the optimism, in late 2004, right after the first direct presidential elections the country had ever held. Despite their threats, the Taliban had failed to disrupt the process. Voting was more or less transparent, despite scattered reports of quick-wash “indelible” ink and disappearing ballot boxes.

Hamid Karzai won by a landslide, and the country was proud of its achievement.

Looking back, those days seem idyllic, filled with hope and expectation.

It is a different world now.

Much has changed for the better. Hundreds of young people have been educated abroad. Millions of children, including girls, are now in school. Almost everyone has a cell phone, and internet-access is spreading.

It would be difficult to think of Afghanistan ever again being quite as isolated as it was during the 1990s, when a mere trickle of information made its way to the outside world.

But the past five years have seen an erosion of hope that has left many Afghans cynical and bitter.

The fledgling banking system, once a source of pride, has been marred by scandal: the $900-million Kabul Bank grabathon eroded what little faith and respect people still had in their government.

The 2009 presidential poll saw blatant vote-rigging and a failure of the international community to adequately monitor the process. The Parliamentary ballot a year later was no better, and set in motion a Constitutional crisis that is still causing waves.

The country is mired in a seemingly endless war, run by a hopelessly corrupt government and deeply conflicted about the presence of international troops.

The Taliban cannot chase the foreigners out, but the combined weight of 48 countries hasn’t been able to crush the insurgency.

Most agree that a political solution is necessary, but many still oppose negotiations with the Taliban.

Night raids and aggressive military operations continue, with the justification that the insurgents must be forced to the negotiating table by the sure prospect of defeat. Anyone who thinks this is possible has never spent much time with Afghans.

A new conference planned for December in Bonn, Germany, seems destined to repeat the mistakes of the first one. Those who were there at the time, such as the U.N.’s Lakhdar Brahimi, have said that not inviting the Taliban sowed the seeds of future problems. But Washington’s newly installed ambassador to Kabul, Ryan Crocker, has already said there is no place for the Taliban in Bonn.

Once the international forces pull out, it’s hard to see how the changes in Afghanistan will last. When the first U.S. troops got on the airplane home, property prices in Kabul began to plummet.

The sleek restaurants, supermarkets, taxi services, and other businesses that have sprung up to cater to foreigners and the newly prosperous will likely be forced to close, leaving thousands of Afghans unemployed.

The hundreds of young people who have been educated in the West will doubtless do what the previous generation did: they will use their education to land lucrative jobs in Geneva or New York.

Many of Afghanistan’s top officials have foreign passports and family tucked away in various Western countries. It will not be a difficult transition for them.

Ethnic tensions and regional disputes that have never been resolved are once again coming to the fore. It is all too likely that the militias now being equipped and trained by U.S. Special Forces will turn their weapons on each other, as they did in the 1990s.

According to many observers, both Afghan and international, Afghanistan is headed for another civil war — a proxy battle with the United States and its allies funneling weapons and cash to one side, and regional powers like Pakistan, Iran and Saudi Arabia each backing their favorite horses.

Ten years after 9/11, with hundreds of billions of dollars spent, thousands of lives lost and immense goodwill squandered, Afghanistan seems to be going backwards.