The top commander of U.S. and allied forces in Afghanistan denounced Russia and Iran during a Pentagon briefing Friday, charging the two nations were “legitimizing” the Taliban inside Afghanistan.

TWO US SERVICE MEMBERS KILLED FIGHTING TALIBAN IN AFGHANISTAN

“Russia has overtly lent legitimacy to the Taliban,” Gen. John W. Nicholson told reporters. “This public legitimacy that Russia lends to the Taliban is not based on fact, but it is used as a way to essentially undermine the Afghan government and the NATO effort … so it’s not helpful.”

“Shifting to Iran, you have a similar situation. There have been linkages between the Iranians and the Taliban,” said Nicholson.

US EMBASSY IN AFGHANISTAN CLOSES AFTER ATTACKS

Referring to Russia, the general explained, “There is a competition with NATO.” He added, “We would like to see a change in their behavior.”

Nicholson also said Pakistan, a longtime U.S. ally, was lending support to the Taliban, which has launched a string of deadly attacks in the past week.

He also said the Taliban-affiliated Haqqani network was holding five Americans hostage. The State Dept designated Haqqani a terrorist organization in 2012.

Taliban forces recently killed 23 civilian across Nash district, Kandahar Province, Afghan police official Gen. Abdul Raziq said Friday. He said 29 Taliban fighters and six Afghan security servicemen had been killed in battles in the district.

Earlier, Taliban fighters killed four border police in an ambush in the southern province of Zabul. Bismullah Afghanmal, the provincial governor of Zabul, said the police were ambushed while on a foot patrol in a mountainous area. He said several Taliban also were killed in Sunday's clash, but had no additional details.

Two U.S. service members in Afghanistan died while fighting the Taliban in early November. Since early October, 11 Americans have been killed in combat in Afghanistan.

Fox News’ Lucas Tomlinson and The Associated Press contributed to this report.