Washington(CNN) Russian President Vladimir Putin is turning to an old enemy -- the Taliban -- to share intelligence as the number of ISIS fighters grow in regional neighbor Afghanistan.
Russian Foreign Ministry spokeswoman Maria Zakharova said the contact between Moscow and the Afghan Taliban only involves intelligence-sharing and information exchange regarding the fight against ISIS.
Why would Putin put himself in a risky spot by working with the Taliban? He's aligning himself with the enemy of his enemy.
A U.S. commander last month told Congress that ISIS has gained strength in Afghanistan in recent months, with as many as 3,000 fighters there.
Putin has long worried about thousands of jihadists from Russia's Caucasus region and the former Soviet republics going to fight with ISIS in Syria.
Afghan forces on offensive against Taliban in Sangin
He may be trying to cut off the pipeline of fighters closer to home, in Afghanistan, one expert told CNN.
"The ties between ISIS and the insurgency in the north Caucasus, the fact that there are people from the north Caucasus fighting in Syria -- maybe not as many as the Russian government says, but certainly a good number, including in leadership roles -- means that Russia does see ISIS and a lot of the other Islamist groups as a particular threat, in a way that maybe the Taliban isn't," said Olga Oliker of the Center for Strategic and International Studies in Washington. "So the Russians may think they (the Taliban) are the lesser of the available evils."
Lt. Gen. Mark Hertling, a CNN military analyst, said a map shows the situation, with Afghanistan bordered on the north by former Soviet republics Turkmenistan, Uzbekistan and Tajikistan and Kazakhstan between those nations and Russia.
Blair: We live with the 'pain' of Iraq, Afghanistan wars
"Russia and Mr. Putin are very concerned about the passage of terrorists, insurgents, Islamists between those borders," Hertling said.
Working with the Taliban presents some risk for Putin, who has been boldly extending his reach with aggressive moves in Syria, Ukraine and with North Korea.
For their part, the Taliban issued a statement Friday denying any contact with the Russian government. The Taliban denied needing any help in the fight against ISIS but maintained they had the right to request assistance from other nations.
Analysts said Putin's moves are all about projecting relevance and strength.
"He wants to go back to the 1970s, when the Soviet Union and the United States were equals as geopolitical leaders, as Cold War rivals, but they still sat down and they did deals," said Matthew Rojansky of the Woodrow Wilson Center.
Former CIA counterterrorism official Philip Mudd concurs, calling Putin's a "pretty serious power grab." Putin is seeking to enhance his relationships with those former Soviet republics.
"What Putin is doing now is telling those states, 'I will work with the Taliban to ensure that we have an agreement to collect intelligence about ISIS before they come across the border,' " Mudd said. " 'When I collect that intelligence, I will pass it back to you.' This is as much about restoring those relationships and trust with the central Asian republics and competing with the United States as it is about countering ISIS in Afghanistan."
The emergence of ISIS in Afghanistan is another major worry -- not only to Russia but also to the United States. Much of the violence in the country wracked by war and an insurgency has involved the Taliban. But al Qaeda -- which, led by the late Osama bin Laden, called Afghanistan home before the September 11, 2001, terrorist attacks -- continues to be a threat.
A U.S. State Department official told CNN when asked for comment on the Russian-Taliban agreement: "Russia and other regional actors all have a shared interest in supporting the continued security and increased stability of Afghanistan. We hope that we can continue to find ways to work with Russia to promote Afghanistan's security and stability."
Another U.S. official told CNN that Washington doesn't see this action as undermining the stability it is working with the Afghan government to achieve. But what would be destabilizing, the official said, is any contact with the Taliban that would legitimize the group with international recognition.
Moscow addressed Russian media reports about Russia supplying weapons to fighters in Afghanistan.
The only weapons that would be transferred on a commercial basis would go directly to the Afghan government and would not involve the Taliban because of sanctions against the group, said Zakharova, the Russian Foreign Ministry spokeswoman. Russia "strictly follows the sanctions regime against the Taliban," she said.