An Afghan soldier holds his rifle outside a gateway to Kabul's airport following a shooting incident on April 27. (Musadeq Sadeq/AP)

I remember walking down a side street in central Kabul in 1983 when I was approached by two young Afghan soldiers of the Soviet-trained Democratic Republic of Afghanistan (DRA) army. They thought I was an off-duty Soviet officer and greeted me warmly in Russian. I responded in Dari that I was American, not Russian, but I am not sure they believed me. They laughed and shouted, “America no good, Islam no good,” and they spat on the ground. Smiling, they added proudly, “We are communists.”

At the time, the Soviets were still winning their war in Afghanistan, but the U.S.-backed mujaheddin insurgency was gaining ground. During my years there, between 1983 and 1985, the insurgents shelled Kabul indiscriminately almost every evening; bombings, gunbattles and assassinations were common, and fierce battles raged in contested areas on the outskirts of the city. Throughout Afghanistan, Soviet forces routinely pummeled villages whose inhabitants were suspected of supporting the mujaheddin. (Civilian casualties were never a major concern for the Soviets.)

But in spite of the vicious fighting and the atrocities committed by both sides, thousands of young Afghan men renounced Islam, became communists and joined the DRA army to fight the insurgency. Whether they were true believers in Marxism-Leninism is far from clear, but they were happy to be on the winning side — with a monthly salary, free mess hall food, new uniforms and an issued rifle. In their decade-long war, the Soviets rotated more than 115,000 troops in and out of Afghanistan each year, and spent billions of rubles training the DRA army and launching extensive nation-building efforts.

Today, the soldiers of the U.S.-led International Assistance Security Force (ISAF) are in their 10th year of combat in Afghanistan. Much as the Soviets did, the ISAF has devoted enormous resources to training local forces, and it is pinning its hopes of scaling back its presence in the country on the ability of the ISAF-trained Afghan National Army (ANA) to eventually assume responsibility for security.

After the Soviet army retreated back across the Amu Darya in 1989, many DRA communist soldiers who had fought against their mujaheddin brothers fled the country, too. Many others discarded their DRA army uniforms and returned to their villages with their Soviet-supplied weapons to swear allegiance to their traditional warlords. Still others reembraced Islam, and some joined the Taliban insurgency a few years later when the Taliban began winning the civil war.

And some of these former soldiers are now wearing the uniform of the ISAF-trained Afghan National Army.

In early 2002, I was again in Kabul and again found myself talking to young Afghan soldiers, this time members of the ANA. Just months before, in November 2001, U.S.-backed Northern Alliance fighters swept across the Shomali Plain into Kabul, driving out the last remnants of the Taliban regime and forcing its al-Qaeda allies to flee across the border into Pakistan. The soldiers I spoke with seemed proud and cocky. They were carrying new weapons, earning a monthly salary and eating free mess hall food. They saw hope for their future and gave me the thumbs up sign, saying in English: “America very good, Taliban no good, Osama bin Laden no good, too.” They were on the winning side, and they loved the United States.

Now, the ISAF has been training the ANA for a nearly a decade, and the Taliban is resurgent. There is relative peace in the northern city of Mazar-e-Sharif and in the large western city of Herat, but many of the primarily ethnic Pashtun provinces bordering Pakistan remain contested. Regardless of how well the ISAF and the ANA perform, violent tribal feuding and internecine warfare will remain part of life in large swaths of the country; it is hard to imagine that Afghanistan will ever be fully pacified. Ancient rivalries and alliances are the core of the country’s tribal power structure, and the violent struggle to protect one’s power base is a perpetual endeavor for tribal leaders. The ISAF needs to decide what is an acceptable level of violence — and who should be responsible for containing it.

Whether they fight for the DRA, for the mujaheddin, for warlords against one another’s tribes, for the ANA or for the Taliban, many Afghans fight if they believe they are on the winning side. Some join the Taliban because they remember that the Taliban recently ruled Afghanistan and they believe it will rule again. Some Talibs fight because they believe, wrongly, that the ISAF is a coalition of conquering Christian armies occupying their country and battling their religion and culture. And many Talibs fight because they are very poor and disenfranchised and have nothing to lose.

Our men and women in uniform have performed heroically in Afghanistan, but it is now time for the ANA to be battle-tested on a large scale and to take the lead in fighting this war. Without major victories on the battlefield, and without seizing and holding battle space, the ANA will never attain the confidence and reliability it needs to be a viable force, and it will become more fearful of the al-Qaeda-assisted Taliban, less motivated to fight or even apathetic.

Regardless of whether a cease-fire is eventually realized with so-called moderate Taliban members and peace comes to Afghanistan in the short term, some hardened and irreconcilable elements of the Taliban are likely to fight on. It is likely that a lasting peace will be enforced only at the end of a gun barrel, and a large, empowered and professional ANA must be holding that gun.

Unless the ANA begins controlling territory on its own accord, compiling a winning record without direct ISAF military assistance, it is very possible that it will degrade and fragment after the departure of ISAF combat forces, much as the DRA disintegrated after the Soviet withdrawal in 1989. The current civil war with the Taliban would expand, with deserting ANA soldiers fleeing with their ISAF-supplied weapons to join the Taliban or rejoin tribal militias. The ISAF-trained ANA could repeat the Afghan army’s history of collapse, ushering in an era of protracted violence and instability of a magnitude not yet seen in the region.

Michael F. Walker retired last year after three decades in the Central Intelligence Agency, most recently as chief of the Near East and South Asia division from 2007 to 2010. He is an adjunct professor at Georgetown University’s Center for Peace and Security Studies.

Read more from Outlook, friend us on Facebook, and follow us on Twitter.

Former CIA official Michael F. Walker on why the Afghan army must win some battles