On the outskirts of a remote district in northern Afghanistan's Takhar province, about 80 armed men gathered near the front line of a Taliban-controlled village, ready for battle.
Half the fighters were members of the Afghan Local Police, a U.S.-backed militia supervised by the Afghan interior ministry. The others were guns for hire loyal to local power brokers, some of whom are paid with the proceeds from opium sales.
For more than three hours the combined forces battled the Taliban in the Koka Bloq area of Eshkamesh district, killing several insurgents including Qari Omar, the top local Taliban official, according to government accounts of the July fighting.
When the battle was over, the armed groups went their separate ways. But next time, the guns for hire and police could just as easily be shooting at each other.
As Afghanistan tries to institute reforms in its security sector, it has struggled to bring order to the dizzying array of militias, irregular fighters, personal bodyguards and other armed groups that often fight the Taliban but also battle among themselves.
In Takhar, which lies along the border with Tajikistan, local officials say influential figures have created several irregular armed groups to carry out private missions in various districts. They cultivate hashish, smuggle it and opium to Tajikistan and extort local farmers with ushr – an Islamic land tax usually levied only in times of economic crisis.
Both the irregular militias and ALP units have been accused of robberies, killings, blackmail and forcing women into marriage, provincial officials say.
"They have taken government weapons for their own benefit and have had several clashes over power, drug deals and other internal issues," said the deputy governor of Takhar, Farid Zaki.
A key driver of the conflict in Takhar is the poppy crop from which opium is produced, the main revenue source for Afghan armed groups, chiefly the Taliban. Local officials say poppy is smuggled into Takhar from neighboring Badakhshan, one of Afghanistan's most isolated regions, and trafficked to surrounding provinces. Afghanistan's thriving poppy harvest is worth an estimated $3 billion a year, according to the United Nations, although growing, transporting and selling it remain illegal.
Officials say fights over opium and hashish smuggling routes have contributed to insecurity that has helped the Taliban gain ground in Takhar and Kunduz province, to the west. Insurgents this month launched an offensive to retake Kunduz, Afghanistan's fifth largest city, which they briefly seized a year ago.
"Lawmakers and some powerful figures in Takhar fight for their share of opium, and these disputes pave the way for the insurgents to infiltrate easily," Zaki said.
As the U.S. troop presence shrinks — to 8,400 in 2017, down from more than 100,000 in 2010 — and Afghan security forces prove unable to bridge the gap in security, the personal militias created by Afghan power brokers are proliferating again.
In Kunduz, the Afghan government has relied on private militias to bolster security against the Taliban when soldiers and police fail to do so. The militias – dubbed "uprising" forces because their precursors rose up against the insurgents -- have been accused of abusing civilians, eroding support for the government and making it easier for the Taliban to gain ground, according to officials and analysts.
The Afghan government supports uprising groups with cash, logistics and ammunition in some areas, although they are not officially part of the government security forces. Sediq Sediqqi, spokesman for the interior ministry, said the government sees the uprising groups as "positive elements."
"The main reason for Taliban inroads in the northern provinces since 2010 is attributed to the abusive behavior of local commanders [of militias] formed under the anti-Taliban uprising movement," Ali A. Jalali, a professor of strategic studies at the National Defense University in Washington, wrote in a May 2016 commentary.
In some cases, as in Takhar, the uprising militias have overlapped and occasionally clashed with official militias such as the ALP, a force of 30,000 nationwide who serve as a defensive force in their villages and towns.
Initially trained by U.S. special operations forces starting in 2012, the ALP has spread to 30 of the country's 34 provinces in part because of its relatively low cost. ALP members often supply their own weapons and are paid salaries of about $100 or more per month, a fraction of what soldiers and police make.
ALP members have sustained disproportionately heavy casualties because they are often deployed in remote areas and are not sufficiently trained. Some ALP units have also been accused of abusing civilians and participating in corruption at the behest of the local law enforcement officials, factional leaders or strongmen who serve as their commanders.
With U.S. government funding for the ALP, which costs $121 million annually, due to expire in 2018, Afghan officials have sought to hasten reforms in a bid to keep the financial support coming.
After U.S. government auditors and Afghan local officials indicated last year that there were perhaps thousands of "ghosts" on the ALP payroll – nonexistent fighters whose salaries were pocketed by officials or commanders – the Afghan interior ministry announced it had made reforms.
Deputy interior minister Mohammad Salim Ihsas told reporters in July that officials had fired ALP fighters who were under the influence of power brokers and that 95% of the force was free from the sway of those individuals. He said that a total of 40% had completed a vetting process under which local tribal councils vouch for the fighters and that the remaining 60% would also undergo the process.
In Takhar, those claims rang hollow. Provincial governor Yasin Zia, who helped lead the battle in Eshkamesh in July, accused ALP and other militia commanders in the province of drug-running, human rights abuses and selling ammunition to the Taliban.
Known for a blunt, swaggering style, Zia told the Eshkamesh district governor in a phone call before the battle to warn ALP commanders there not to sell arms being provided to them by the interior ministry.
"If they do, they can use the money to pay for their coffins," Zia said.
Later, in Baharak district, Zia confronted an irregular militia commander, a man named Dawood, whom the governor accused of robbing civilians along the highways in Takhar. Zia bound his arms with plastic cuffs and threw him into one of his vehicles as a crowd watched.
A short time later, Zia received a series of phone calls from local intelligence and police officials, urging him to release Dawood.
"Bad for Dawood means bad for me," Ibrahim Begzad, head of intelligence for the provincial police chief, told Zia.
Believing the officials were in cahoots with Dawood's militia and could retaliate, Zia released him.
"I have no choice," Zia said afterward. "If I lock him up, things will get worse. It's not about one commander. All the criminals are linked to each other."
In some cases, the formal and informal militias overlap. In Eshkamesh, a member of the Afghan parliament sponsors both the ALP and an uprising group through a local police official, tribal leaders and others said.
The leader of the uprising group, Mohammad Gul, said he was paid $58 per month as a militia leader. In the same district, ALP member Naqibullah, a 25-year-old wheat farmer, said he had not been paid by the government since he joined last year.
Zia and others believe the ALP unit supplements its income through illegal means.
"Our war is not only with the Taliban," Zia said. "It's also an internal war."
Special correspondent Faizy reported from Eshkamesh and staff writer Bengali from Kabul, Afghanistan.
Follow @SBengali on Twitter for more news from South Asia
MORE WORLD NEWS