Russia and Iran are “hedg[ing] their bets” by backing the Taliban against other terrorists at the expense of Afghanistan’s central government, a senior State Department official testified Wednesday.

“We are concerned about countries that are seeking to hedge their bets in Afghanistan, typically by viewing the Taliban as a legitimate force in fighting ISIS-Khorasan,” Alice Wells, the top diplomat for the Bureau of South and Central Asian Affairs, told the House Foreign Affairs Committee.

U.S. officials have accused Russia repeatedly of undermining American efforts to stabilize Afghanistan by providing weapons to the Taliban. Russia has denied the charges, while hinting at more aggressive efforts to counter the emergence of an Islamic State affiliate in the country.

“Our strong view is that the only way to defeat terrorism and to bring peace to Afghanistan is to strengthen the Afghan government and to strengthen the government's ability to fight terrorists,” Wells said.

Russian Foreign Minister Sergey Lavrov suggested in April that an international security bloc co-founded with China might have to take a larger role in the Afghan conflict. “We must redouble our efforts to preclude the proliferation of conflicts from Afghanistan and to promote a political settlement of the Afghan crisis,” he said following a Shanghai Cooperation Organization summit.

But Defense Secretary Jim Mattis has been critical of Russian efforts in Afghanistan, saying last year that arming the Taliban is the latest example of how “the Russians seem to be choosing to be strategic competitors in a number of areas.”

More bluntly, the U.S. envoy to NATO accused Russia and Iran of "propping up the terrorist networks that are killing innocent people” — a charge leveled just days after Lavrov’s comments at the Shanghai summit.

“Russia is not helping at all. ... Iran is not helping at all,” Ambassador Kay Bailey Hutchison told Radio Free Europe/Radio Liberty, a U.S.-backed outlet. “We hear this when we’re in Afghanistan, and we hear from the military leaders. They talk about the enablers — those who have the money and the capacity to be helpful but instead are really propping up the terrorist networks that are killing innocent people.”

But Wells acknowledged the need to collaborate with Russia and Iran if a long-term settlement is to be achieved. “Russia and Iran do have an important role to play in the future stabilization of Afghanistan,” she said. “Afghanistan’s neighbors are going to have to support any peace process that emerges between he Afghans and the Taliban.”