When the Soviet Union withdrew its army from Afghanistan in 1989, its defeat seemed complete and irreversible. Most Afghans bitterly repudiated the attempt to impose communist rule by force.

An Afghan communist officer who fought with the Russians told me that his side lost because they could not overcome their image as atheist infidels.

Today, however, Russia is seeking to remake its image by exploiting Afghan disappointment with the dismal results of the post-9/11 intervention by the U.S. and its allies.

Trending: Was McCain’s Trumpcare Vote an Act of Courage or Political Theater?

This Russian deployment of so-called “soft power” appears to be paying dividends in ways that could hardly have been predicted when the Soviet Army left Afghanistan after nine years of war.

The Russians are ramping up political, economic and propaganda activities to improve their image and reestablish their influence amid pervasive corruption that is impeding progress in Afghanistan.

Regardless of the gains that have been made in some areas, masses of unemployed Afghans have lost hope and are emigrating in unprecedented numbers. Afghan soldiers are fighting valiantly, but terrorist attacks are on the rise and the U.S.-backed Afghan government appears incapable of establishing security across the country. The bulk of U.S. and NATO military forces have departed, aggravating Afghan fears of being abandoned again by the West.

According to the Moscow-based Center for Contemporary Afghan Studies, Russia is seeking to “help shape events on the ground” by cultivating closer ties to the Afghan government.

Russia has expanded its embassy staff and signed a security agreement with Afghanistan in 2016, reportedly shipping in 10,000 Kalashnikov rifles and millions of rounds of ammunition. In the economic sphere, President Vladimir Putin's special envoy to Afghanistan, Zamir Kabulov, promised to support Afghanistan's housing sector during his February meeting with Afghan President Ashraf Ghani.

Story continues

Don't miss: Russia Invited NATO Militaries to Join Tank Olympics But They 'Aren't Ready' Says Russian General

The Russian Embassy spent $20 million to rebuild the abandoned Soviet Friendship Center. Hoping that it will regain its previous role in promoting an affinity for Russia, the embassy reopened it as the new Russian Cultural Center, but many Afghans still use the original Soviet name. And that’s just one of 150 projects Moscow has undertaken at a cost of tens of millions of dollars in its effort to restore Russia’s lost economic and cultural clout in Afghanistan.

Although this level of expenditure is small in comparison to the billions of dollars being spent by other countries, Russia, unlike the U.S., has an effective propaganda apparatus to publicize its aid projects. Pro-Russian media promote the perception that Soviet infrastructure projects, such as the Salang Tunnel and the Band-e Sardeh dam, were better built than what came afterwards.

Pro-Russian stories depict a stark contrast with wasteful U.S. spending. Independently, wasteful U.S. spending has been documented in reports from the U.S. Special Inspector General for Afghanistan Reconstruction.

Intent on promoting a positive image among Muslims, Russia has publicly announced assistance to the Taliban to help it resist ISIS and promote peace negotiations.

General John Nicholson, commander of U.S. forces in Afghanistan and other American officials see it differently. They accuse Russia of aiding the Taliban to destabilize Afghanistan and undermine U.S. interests.

Most popular: Two Prisoners Remain on the Loose After Mass Alabama Jailbreak

From Russia’s perspective, however, the dual strategy of backing the government and the insurgents positions it to accommodate whoever comes out ahead. Afghans add matter-of-factly that Russia, in keeping with its long history of involvement in their country, also exerts influence through covert funding to political leaders and groups outside the government.

At present, Russia is enjoying a remarkable comeback in the land that once fought so violently to expel it. According to an experienced Afghan businessman, the growing Russian engagement in Kabul business ventures and other activities produces negative comparisons with Americans.

While the latter have gained a reputation for living behind walls, afraid to venture out among Afghans because of the terrorist threat, the Russians reportedly walk the streets openly, take taxis and visit Afghan associates and friends in their homes without security escorts.

The theme of American fear of Afghans evidently is taking root. Several Afghan elders that I interviewed in the context of a counterinsurgency study told me spontaneously that the “Russians were braver than you [Americans].” When I posed this question to an old mujahid commander who had waged fierce battles against the Russians, he pondered it for a moment and responded that they were not braver but instead were more ruthless, obliterating entire rebel villages.

When I countered that this ruthlessness did not gain victory in the end, and the Russians must have made serious mistakes, he responded: “Mistakes? No. They simply ran out of money.”

It could be argued, however, that they did commit a fundamental mistake. The Russians undertook a massive military campaign in 1979 in Afghanistan without the resources or popular support to sustain it. They apparently learned their lesson.

As Russian General Valery Gerasimov has advised, Russia is successfully implanting “non-military means of achieving political and strategic goals.”

Arturo G. Muñoz is a senior political scientist at the nonprofit, nonpartisan RAND Corporation.

More from Newsweek