Despite the bloody war between the Afghan government and the Taliban, the two share a common enemy: the "Islamic State." This has led to some inadvertent cooperation between both sides.
In a major setback for "Islamic State" (IS) in Afghanistan, over 150 of its fighters recently surrendered to security forces in the northern Jawzjan province. The credit for their defeat, however, does not directly go to Afghan government troops, but to the Taliban.
"There were heavy clashes between the Taliban and IS during the last two months. As a result, many foreign IS fighters fled the area, but Afghan members of the group surrendered to the government," Abdul Hai Hayat, the head of the provincial council in Jawzjan, told DW.
Read more: Why Taliban won't make peace with Kabul
The Taliban also claimed to have killed over 130 other IS members.
The fighting between the two sides took place in the IS strongholds of Darzab and Qush Tepa districts, which the group had captured from the Taliban nearly two years ago. The Taliban, Hayat said, had been trying to take back control of the territory since last year.
"More than 2,000 Taliban fighters came to these two districts in the last two months and they were able to defeat IS," local officials said.
The Taliban and IS have engaged in intense fighting since the latter first emerged in Afghanistan in late 2014 and successfully established a chapter in the eastern part of the war-torn country in January 2015.
Both the Taliban and IS oppose the government in Kabul. But they are deeply divided over leadership, ideology and tactics. Their brutal conflict, however, is for the most part rooted in their quest for control over territory.
The Taliban – a much stronger armed group in comparison to IS in Afghanistan – view themselves as the main Islamist opposition in the country. Their stated aim is to overthrow the Western-backed government in Kabul and impose a harsh form of Islamic rule.
IS, on the other hand, aims to turn Afghanistan into its South Asian base and expand its presence to other countries in the region. "It is due to such differences and very brutal acts by IS, that the Taliban are favored as an armed opposition compared to IS," said Yonus Fakur, a Kabul-based Afghan political analyst.
The Afghan government and its international allies benefit from the rivalry between the Taliban and IS.
Last month, General John Nicholson, the top US commander in Afghanistan, welcomed the fact that the Taliban were fighting IS, which he said had to be destroyed.
US forces have also launched air strikes against IS fighters in Jawzjan in recent months.
An unlikely alliance?
Some say Afghan security forces are giving Taliban fighters a free pass when they go to fight IS. "The fact that over 2,000 Taliban fighters could gather in one place in the course of just two months suggests that Afghan forces turned a blind eye to the insurgents' movements," Fakur said.
But the head of Jawzjan provincial council did not confirm such reports. Instead, he merely stated that Afghan forces had reduced operations during encounters between Taliban and IS fighters. Afghan officials and the Taliban also reject any suggestion of cooperation between the two sides.
Faqir Mohammad Jawzjani, head of provincial police in Jawzjan, told DW his troops have gone after both militant groups.
"They are both enemies of the Afghan people and we will fight them both," he said. "If they attack us or the locals, we will take action against them," Jawzjani replied when asked how his forces were planning to deal with the over 2,000 Taliban fighters in the area.
The contradictory statements and actions highlight the predicament in which the Afghan government finds itself, said Fakur. "They suggest the government is turning a blind eye to Taliban activity as soon as IS comes into the picture," he underlined.
"As they say, 'an enemy of an enemy is a friend.' Both Kabul and the Taliban want to defeat IS and it is likely that in some cases they help each other out to achieve this goal," he said.