By Jessica Donati and Mirwais Harooni

FARAH, Afghanistan (Reuters) - In fields less than a 10-minute drive from the intelligence headquarters of Afghanistan's remote western province of Farah, farmers are planting their first illegal opium crop of the year.

Taliban insurgents control half of the region bordering Iran, government officials estimate. In one district, Khaki Safed, the sacked local government chief refuses to step down.

Worried villagers there say a former Taliban commander is leading an armed band several dozen strong who have pledged allegiance to Islamic State.

Farah offers a prime example of Afghanistan's nexus between Islamist militancy, crime, opium and Kabul's feeble grip on power. Residents say problems escalated after foreign troops withdrew in early 2013 and locals in Farah's most lawless areas say the breakdown in order is complete.

"There are four administrations in Khaki Safed," said Benyamin Akhunzada, a bearded farmer in his 50s, keeping warm with a traditional wool shawl over his shoulders.

"One is the governor. Another is Afghan local police. Another is the Taliban. Another is Daish," he added, using the title popular in South Asia for Islamic State.

"These four administrations are harassing locals. None of them serve the nation, but just take advantage," said Akhunzada, speaking in the provincial capital, also named Farah.

The poppy grower ends up with 4-6 kg (9-13 lbs) of opium to sell after he has handed over a portion of his produce each year to rival armed groups in the form of "taxes".

He sells what is left to smugglers, who this year paid 9,450 Afghanis ($165) per kg of the plastic-wrapped gum.

Asif Nang, Farah's incoming governor, said he was struggling to impose his writ on unruly districts.

"Security is a priority," he told Reuters at his heavily fortified compound in Farah city, guarded by dozens of men.

"I focus most of my time at the district level ... but unfortunately, due to the weak management of governors' offices, we have a lot of work to do."

Story continues

TALIBAN "ACT LIKE GODFATHERS"

Akhunzada's crop, and his commercial links to armed groups and criminals, illustrate a nationwide problem.

Farah has doubled its poppy harvest in five years, is Afghanistan's third largest opium producing region and occupies a key position in the narcotics smuggling network.

Afghanistan produces about 90 percent of the world's illicit opiates, making narcotics a major revenue source for overlapping networks of the Taliban, mafia-like gangs and politicians.

Andrey Avetisyan, the regional head for the U.N. Office on Drugs and Crime, said narcotics posed the greatest threat to stability in Afghanistan and last year's record poppy crop could be exceeded in 2015.

The United Nations estimates the farm gate value of opium was $850 million in 2014, with the export value far higher, and says the Taliban earns tens, if not hundreds of millions of dollars a year by taxing the trade.

The Taliban, which wants to re-impose strict sharia, or Islamic law, across Afghanistan, says it does not force growers to pay for poppy cultivation, but accepts voluntary contributions from anyone.

A report for the U.N. Security Council this month said the Taliban was financed more and more by heroin laboratories, illegal ruby and emerald mines and kidnapping.

"They are increasingly acting more like 'godfathers' than a 'government in waiting'," it said. Such vested interests could complicate efforts to negotiate peace, as Afghan President Ashraf Ghani wants to do.

Last year a record number of Afghan civilians were killed in militant violence, as well as around 5,000 security personnel, as NATO wound down its 13-year combat mission and under-equipped local forces struggled to cope.

"FIGHT TO THE LAST DROP OF BLOOD"

Among the biggest challenges for Kabul is wresting back control of outlying regions.

Major-General Taj Mohammad Jahid, commander of the Western region for the Afghan National Army, recently visited Farah.

"Overall (opium) is a point of concern ... for all Afghans, but the government will fight against it," he told Reuters.

"We are not concerned about small groups like the Taliban or Daish, who hide themselves in mountains or caves. We will fight to the last drop of blood against those who are against our law and people."

Locals are less sanguine about the threat of Islamist violence in Farah. They worry a new band of militants led by former Taliban commander Mullah Abdul Raziq Mehdi may emulate the Islamic State's atrocities in the Middle East.

Like Mehdi, several renegade Taliban leaders have declared allegiance to Islamic State in recent months, although there is little to suggest operational links between the groups in Syria and Iraq and those in Afghanistan.

Farmers from Khaki Safed describe the local "Daish" unit led by Mehdi as having 30 to 100 members who wear black and cover their faces. They travel in pick-up trucks armed with mortars, AK-47s and PK heavy machine guns.

"People have heard about Daish brutalities, and therefore are frightened," said Abdul Ghafor, an elder from the district.

Complicating efforts to bring the district under control, Khodaidad, its newly appointed chief, has been unable to take up his post because his sacked predecessor refuses to leave, saying if he does, Khaki Safed will fall into Taliban hands.

For now Khodaidad operates from Farah, a cluster of busy shopping streets and modest homes that has enjoyed a construction boom which locals link to the drugs trade.

But its social cost is clear. In the ruins of Farah city's ancient citadel, addicts huddle in the cold, smoking opium.

(Writing by Jessica Donati; Editing by Mike Collett-White and Frank Jack Daniel)