(CNN) -- When U.S. President Barack Obama first announced plans for a U.S. troop surge in Afghanistan in 2009, a former commander of Soviet forces in the war-ravaged country warned that history was in danger of being repeated.

He said the United States and its allies were becoming mired in an "unwinnable war," despite the presence of more than 100,000 U.S. troops.

Two years on and Obama has announced plans to withdraw 30,000 troops from what has been a hugely costly conflict, both politically and in terms of lives lost. With the Taliban still a huge threat, this earlier warning now seems chillingly prescient.

Obama outlines troop withdrawal

Gen. Victor Yermakov commanded the Soviet Union's 40th army in Afghanistan from May 1982 to November 1983, one of six commanders to preside over the Soviet task force after its 1979 invasion.

The Kremlin's bloody nine-year campaign to support the Marxist government in Kabul cost the lives of more than 15,000 troops and brought the Soviet economy to its knees before its 100,000-strong army was forced into a humiliating withdrawal.

The strategy of imposing its will on Afghanistan militarily had failed in the face of an unyielding guerilla insurgency, backed ironically by U.S. money and weapons. Afghanistan had become Moscow's "Vietnam War."

"We too entered Afghanistan with a large force," Yermakov told CNN in 2009. "We came there not to conquer Afghanistan but to render international assistance to stabilize the situation there.

"But you cannot impose democracy by using force. An Afghan has agreed with you today, at gunpoint, that American democracy is the best thing in the world, just as he was once saying that the Soviet system was the best.

"But as soon as you turn around, he'll shoot you in the back and immediately forget what he was just saying.

"I would like to remind you what the first man to unite the Afghan tribes, Czar Babur, said: 'Afghanistan has not been and never will be conquered, and will never surrender to anyone.' Afghans are a very freedom-loving and proud people."

Babur was a descendent of Genghis Khan who founded the Mughal dynasty which conquered much of central Asia in the 1500s.

Asked what difference he though Obama's troop surge would make, the 74-year-old former deputy defense minister said, "I can see only one: Obama will be more often going to the airport to pay his last respects to the [airlifted U.S.] soldiers killed in Afghanistan.

"That's the only difference that I can see, whatever the size of the task force."

The U.S.-led coalition first invaded Afghanistan in response to the September 11, 2001, attacks on New York and the Pentagon by al Qaeda. The invasion overthrew the ruling Taliban, which had allowed al Qaeda to operate from its territory -- but most of the top al Qaeda and Taliban leadership escaped the onslaught.

As it had been with the Soviets, the mission was to stabilize the country with a government it favors. But Taliban fighters regrouped in the mountainous region along Afghanistan's border, taking advantage of ethnic ties with sympathetic local tribes to fight against another foreign invader.

Thousands of coalition troops have died in the ensuing conflict, with many of these casualties coming from roadside bombs, known as IEDs (improvised explosive devices), planted by Taliban fighters employing the same guerilla tactics as Mujahideen fighters used against the Soviets.

Is Afghanistan Obama's Vietnam?

But even when the U.S.-led forces managed to achieve their objective of re-taking a village or town from the Taliban, Yermakov claimed they repeated Soviet mistakes.

"Whether it's Tora Bora or Kandahar we would deploy troops, establish order, place a popular government there and render our assistance to it. But when we leave that government or leadership runs away.

"After all who is the leader of a province? If he's not part of the local tribe then nobody's going to pay attention to him."

He pointed out how much of Afghanistan during the Soviet occupation was under government control during the day but at night the power shifted to the Mujahideen. "A similar thing is happening presently with the Taliban," he says.

Asked what lessons the coalition could learn from the bitter Soviet experience, the retired general advised western governments to transfer the money being spent on financing troops to the restoration of Afghanistan itself.

"Restoring Afghanistan's economy, its industrial enterprises, its education system, schools and mosques will increase your authority. War can only evoke resistance. Afghans regard war only as an attempt to enslave them."

According to White House estimates, it costs about $1 million per year to send just one soldier to Afghanistan. That figure includes the cost of the equipment the soldier would need, the fuel to transport the soldier to the theater and move him/her around during their deployment, and food, housing, combat pay, ammunition and other miscellaneous costs.

With a hint of defiance, Yermakov claimed the Soviet Army did enjoy some success.

"We didn't leave [Afghanistan] as a defeated force, he said. "We didn't leave with disgrace. It was our government who decided that we should withdraw, and we accepted that decision -- that the Afghan people should develop independently.

"If we are to speak about what we needed badly, it was fence-mending with the local population. We were expanding those ties, we had met with their religious leaders, mullahs and so on.

"We tried to assist, to persuade -- and it yielded results. And I should tell you that we understood this after about four years of our presence there."

CNN's Maxim Tkachenko contributed to this report.