The brilliant blue stone lapis lazuli, prized for millennia, is almost uniquely found in Afghanistan, a key part of the extensive mineral wealth that is seen as the best hope for funding development of one of the world's poorest nations.

Instead, lapis has become a source of income for the Taliban, smugglers and local warlords, emblematic of the central government's struggle to gain control over the resources and rein in corruption.

Afghanistan is missing out in millions of dollars in revenues from lapis as illegal miners extract thousands of tons from the mines in northeastern Badakhshan province, according to experts and officials. A local police commander named Abdul Malik has control over a major mine, charges illegal miners to use it and pays the Taliban to allow him to operate, according to an internal memo to Afghan President Ashraf Ghani from his top adviser on mines, seen by The Associated Press, and a top official.

Smugglers bribe local officials to turn a blind eye as they transport the gems to Kabul and to neighboring Pakistan for sale, they said.

Stephen Carter, Afghanistan campaign leader at international advocacy group Global Witness, said the country's mining sector "funds armed groups and is a major source of instability and corruption, not just in Badakhshan but across the whole country."

Describing lapis lazuli as a microcosm of the mining sector, he said that without fundamental safeguards, especially to increase transparency and security in mining areas, "there is a real risk Afghanistan could face a chronic, resource-driven conflict."

Javid Mujadidi, a Badakhshan lawmaker, estimates that 70 percent of the proceeds from the lapis lazuli "goes to the Taliban, who have a presence at the mine," located in the province's Kuran-wa-Munjan district in the mountains near the border with Pakistan. The extortion has helped fund the insurgency's spread from the southern heartland to the previously peaceful northern provinces.

Afghanistan has reserves of coal, copper, iron ore, zinc, mercury, rare earths, gems such as rubies and emeralds, gold and silver, and much more. True values are difficult to assess, but Afghanistan's mineral and petrochemical deposits have been valued at up to $3 trillion.

But little of that wealth is mined legally. Homegrown expertise in exploration, extraction and processing is poor. Inadequate infrastructure and lack of security keep international miners out, and recent ventures with foreign companies in iron ore, copper and gold have collapsed.

Afghanistan has a virtual monopoly on lapis, which has been mined in Badakhshan for thousands of years. Egypt's pharaohs treasured lapis jewelry. Renaissance artists ground it to powder for ultramarine pigment. Today it is used for jewelry and ornaments.

Legal mining peaked in 2014 at near 5,500 tons. Rough lapis lazuli ranges in value from $4 to $2,000 a kilogram (2.2 pounds), depending on quality. Illegal mining was rampant and, in an effort to stop it, Afghanistan's National Security Council banned all lapis lazuli mining in early 2015.

But the mines themselves were not secured to prevent illegal exploitation, so Malik was able to take control with apparent impunity, said the official. Malik pays the Taliban in the area about $440,000 a month in protection money, the official said. He spoke on condition of anonymity fearing reprisals from those involved in the illegal trade.

Malik could not be reached by the AP to comment on the accusations. Afghan media have also identified him as controlling lapis mining, and he has not responded.

Malik charges enormous rents to illegal miners allowing them to mine for 24 hours at a time, according to a Dec. 19 memo to Ghani from his senior adviser on construction, mines, water and energy, Mohammad Yousuf Pashtoon. The mines are being damaged by the high explosives that the miners use in an effort to get out as much as possible in their short permitted time, he wrote in the letter, a copy of which was obtained by the AP.

Pashtoon also said Malik's son works for the Badakhshan branch of the national intelligence agency and warns his father of any intended operations against illegal mining or smuggling.

He also wrote that 5,000 tons of lapis mined illegally from Kuran-wa-Munjan was being stored in four districts — Keran wa Menjan, Juram, Barak and Angam, where the Taliban have long had a presence — by the miners, transporters and traders who plan to profit from it. He wrote that 1,000 tons had already been moved to China. Lapis with an estimated market value over $1 billion had been under-declared and tax paid on stone valued at only $230,000.

The contraband lapis is transported to Kabul, hidden in trucks carrying fruit, coal or other commodities. In the capital, it is sorted for global markets and from there most is taken to the Pakistani city of Peshawar, though some is flown to Dubai, United Arab Emirates, or the Indian city of Jaipur. Throughout the process, the central government receives nothing in taxes, and instead all along the route, local authorities and powerbrokers benefit, extracting payments from smugglers.

In Peshawar, most of the lapis is bought by Chinese gem traders. With their purchases of precious stones, "the Chinese are funding the war in this country," said the official.

The NSC, the president's office and the Interior Ministry, which is responsible for security forces, refused requests for comment.

For traders who wish to work within the law, the ban has been financially debilitating. Jurm businessman Qari Abdulwadood has had 2.5 tons of legally extracted lapis in storage for two years at a cost of $8,000 a month. He said has already paid the pre-ban 15 percent royalty and would pay the 9 percent export tax.

"Now they want us to take it to Kabul, to a central storage facility, but there is no security on the way or once we get there. How can we find the foreign buyers who will be able to cover all our costs?" said another local businessman, Ahmad Jan, who has 120 tons of lapis stored in Badakhshan.

___

Associated Press Writer Humayoon Babur in Kabul, Afghanistan, contributed to this report.