Homegrown militants loyal to the Islamic State group are making inroads into Afghanistan, controlling territory in some parts of the country and ruling with the harsh hand the group is notorious for in Iraq and Syria, according to officials, military leaders and analysts.

IS expansion into Afghanistan has been a concern for both Afghan and international authorities for months, with officials warning that the militant group was actively recruiting members from other Islamic militant groups, including the rival Taliban.

Now multiple local and international officials say IS loyalists have increased their visibility and in some parts of the country are violently confronting the Taliban — which is still waging its own 14-year-old insurgency to retake power in Kabul.

There remains some confusion as to whether the growing visibility of the now-familiar IS black flag in Afghanistan constitutes the presence of an actual Islamic State group affiliate. Authorities have yet to confirm the existence of operational or financial links between the local IS loyalists and the militant group's home base in Iraq and Syria. However, the number of local militants flying the IS flag or claiming to be acting in the group's name has increased dramatically.

Some of these are believed to be former Taliban fighters who have broken with the organization and adopted the IS flag out of convenience. But at the very least, authorities say recent events reveal the growing presence and power of factions who emulate the Islamic State group's ideals and seek to mimic its tactics.

In some parts of the country, the extremists have actually begun controlling territory — executing Taliban loyalists, banning girls from school and killing dozens of civilians for resisting their harsh rule, according to Afghan officials.

On Thursday, U.S. Gen. Philip Breedlove, NATO's supreme allied commander in Europe, called IS an "emergent threat" which now occupies "pockets in numerous places around the nation."

He said that while IS loyalists were fighting the Taliban in some regions, their "combat power is less concerning than that they are here making inroads with the people, recruiting."

One of the first serious footholds in Afghanistan for the IS loyalists appears to be in the eastern province of Nangarhar, along the Pakistani border, according to two members of the Afghan parliament.

"Daesh in Nangarhar is growing and getting stronger compared with a couple of months ago. The people of the region are becoming increasingly concerned," said Nangarhar MP Zahi Qadir, using an alternative acronym for the group. "Daesh have told local people to take up arms against their enemies, by which they mean the Taliban, or leave. In the areas where there are Daesh fighters, the schools have been closed and the Daesh fighters have beaten and abducted teachers."

A second parliament member, Hazrat Ali, told The Associated Press that IS loyalists in Nangarhar have banned girls from attending school. Militants have gone door-to-door asking families about unmarried girls and "threatening to marry them to Daesh fighters if they are not married off by their families soon," he said. "Where Daesh exists, there is no life, people are enslaved."

In August, a video was released by purported IS loyalists in Afghanistan showing the brutal killing of a group of men accused of being Taliban sympathizers. In the video, the 10 blindfolded men are made to kneel on top of buried explosives, which are detonated underneath them. The video could not be independently verified, but Hazrat Ali declared it authentic and said the incident took place in Nangarhar's Achin district.

A United Nations report prepared ahead of this month's annual debate on Afghanistan by the U.N. Security Council states that in Nangarhar province, "groups loyal to ISIL and the Taliban are currently clashing in a struggle for resources generated by provincial drug production and trafficking," using another alternative acronym for the IS group.

At stake in the IS-Taliban power struggle is more than just territory. Afghanistan contains billions of dollars in assets — mainly opium that produces most of the world's heroin, but also minerals including gold, marble, chromite, lapis lazuli and gemstones.

Security analyst Ali Mohammad Ali said gaining control of Afghanistan's lucrative resources is one of the main objectives of the Islamic State group, and its loyalists are competing with the Taliban like "organized criminal mafia gangs" for control of billions of dollars in assets. IS has tapped into illicit trade in Iraq and Syria as well, looting artifacts to sell on the black market.

The cash flow from opium or minerals would enable the group to operate in Afghanistan independently of the central leadership, he said. "Their strategy is to be self-sustainable in any guerrilla warfare, to have an indigenous economy and people funded from local resources."

The IS loyalists are recruiting heavily from the ranks of Taliban fighters, seeking to attract jihadis who are frustrated with the Taliban's inability to retake power in Kabul. The recruitment drive also comes at a time when the Taliban is facing an internal leadership crisis after the Afghan government announced in July that their one-eyed leader Mullah Mohammad Omar had been dead for more than two years. Mullah Omar's replacement, Mullah Akhtar Mansoor, has been rejected by members of Mullah Omar's family, and Afghan officials say senior Taliban leaders and field commanders have been meeting in the Pakistani city of Quetta to resolve the dispute. Fighters from the two internal Taliban factions have already come into open conflict inside Afghanistan, according to senior Taliban official Ahmad Rabbani.

Meanwhile Kabul lacks a coherent strategy for dealing with this newest threat to stability, the officials and analysts said. A year after President Ashraf Ghani came to power promising peace, there is still no defense minister, with Masoom Stanekzai, who was rejected earlier this year by the parliament, serving on an interim basis for now. Government forces are struggling alone following the drawdown last year of foreign combat troops, as the Taliban have spread their fight to every corner of the country, and Stanekzai's lame-duck status is believed to be undermining his authority.

Other pockets of IS support have appeared in southwestern Helmand province. In February, a U.S. airstrike killed a group of alleged IS recruiters there, according to Afghan officials and the Pentagon.

In the northern provinces of Faryab and Sar-i-Pul, the Islamic Movement of Uzbekistan or IMU declared their loyalty to the Islamic State group earlier this year. First Vice President Gen. Abdul Rashid Dostum, formerly an Uzbek warlord, spent much of August in his northern stronghold battling IMU militants, according to Sultan Faizy, Dostum's spokesman.

Faizy estimated up to 2,000 militants in Afghanistan are currently loyal to IS, including about 500 IMU fighters. He said the IS loyalists are principally "working on recruitment, making bases, increasing their influence among the people."

It can be a persuasive recruiting pitch, Faizy said, particularly for disaffected Taliban fighters who see IS as an organization on the rise and "who know that the Taliban era is almost over."