MAKRAK, Afghanistan—Mullah Ibrahim, a stocky white-bearded cleric, was leading two men in prayer at dusk early this month when three assailants approached his mosque in a pomegranate grove in rural Zabul province.

One of them climbed over a low clay wall behind the two worshipers, who were absorbed in prayer, approached the cleric and shot him in the face, witnesses said. Once the mullah fell to the ground, another person shot him four times in the chest.

The...

MAKRAK, Afghanistan—Mullah Ibrahim, a stocky white-bearded cleric, was leading two men in prayer at dusk early this month when three assailants approached his mosque in a pomegranate grove in rural Zabul province.

One of them climbed over a low clay wall behind the two worshipers, who were absorbed in prayer, approached the cleric and shot him in the face, witnesses said. Once the mullah fell to the ground, another person shot him four times in the chest.

The killers haven’t been identified. Villagers here in the Mizan district of Afghanistan’s southern Zabul province said the cleric had been linked to a group that is an archenemy of the Taliban: Islamic State Khorasan Province, or ISKP.

It was the latest in a series of killings of religious figures associated with ISKP, Islamic State’s regional affiliate, since the Taliban overthrew the Afghan republic and seized Kabul on Aug. 15.

Western officials and Afghan residents in the affected areas say they believe the Taliban have carried out the killings. The Taliban have publicly denied responsibility, but have admitted privately to a number of killings of ISKP militants.

The Taliban and ISKP both want to impose strict Islamic rule on Afghanistan, but they have deep religious and political differences and have repeatedly clashed.

Islamic State’s Afghan franchise, which is also known as ISIS-K, poses a threat to the country’s new rulers because it was formed by former Afghan and Pakistani Taliban members who thought that the insurgent movement wasn’t radical enough.

A Taliban intelligence officer last week in Afghanistan’s rural Zabul province.

Now, Islamic State could attract disgruntled Taliban foot soldiers who may disagree with potential compromises made by Taliban leaders as they seek to woo the international community in a bid to win diplomatic recognition and a resumption of foreign aid.

The Taliban are working to choke any challenge to their rule as they transition from a guerrilla-style insurgency to a government.

“We don’t differentiate between Islamic State and Americans. For us they are the same,” Safiullah Haroun, a Taliban intelligence officer in Zabul, said in an interview “Anywhere they rise up, we finish them.”

Mr. Haroun said he had recently sought to arrest a local Islamic State cleric in a village near Makrak, but failed and instead detained his son.

He played down the threat now posed by the group. “We killed all of them,” he said about Islamic State fighters, but denied any involvement in the death of Mullah Ibrahim.

Hamidullah Fitrat, a Taliban spokesman for Zabul, said that the Taliban didn’t kill the mullah and are investigating the incident.

Islamic State hasn’t commented on Mullah Ibrahim’s death.

A suspected Islamic State member was apprehended by the Taliban earlier this month.

Photo: wana news agency/Reuters

In recent weeks, a spate of ISKP attacks have sought to undermine the Taliban’s consolidation of power, with several improvised explosive devices targeting Taliban Humvees and Ford Rangers in the eastern city of Jalalabad, one of Islamic State’s strongholds. An Islamic State suicide bomber on Aug. 26 targeted a gate of the Kabul airport, killing about 200 Afghan civilians who were trying to flee the country and 13 U.S. troops.

Islamic State, which has been behind some of the most brutal attacks in Afghanistan in recent years, particularly against Shiite civilians in cities, rejects the notion of a nation state or of peace with those it views as infidels.

Now that the sophisticated surveillance and intelligence-gathering systems used by the U.S. and its allies have disappeared following last month’s military withdrawal, the group is likely to intensify its attacks, with less fear of being detected and stopped, Western officials and analysts say.

That poses a political problem for the Taliban, said Michael Semple, an expert on Afghanistan at Queen’s University Belfast. “Taliban promises to bring everlasting peace look hollow when your [Ford] Rangers are blown up from under you,” he said, referring to the pickup trucks commonly used by the Taliban.

While offering an amnesty to security officers of the former Afghan republic, the Taliban have shown no mercy to Islamic State, killing one of the group’s main leaders in a Kabul prison hours after seizing the Afghan capital.

A Taliban fighter stood guard at the site of a suicide bombing at Kabul airport in August that killed about 200 Afghan civilians and 13 U.S. troops.

Photo: wakil kohsar/Agence France-Presse/Getty Images

Two prominent clerics believed to be close to Islamic State, Abu Obaidullah Mutawakkil and Muhammad Nabi Muhammadi, were found dead in Kabul this month. The Taliban denied being behind these killings, too.

On Wednesday, the bodies of four people were discovered in Jalalabad. Arafat Mahajir, the Taliban’s acting director of information and culture there, said in a WhatsApp group that the Taliban had killed them for their links to Islamic State.

In another WhatsApp message seen by the Journal, Taliban intelligence in Zabul asked residents to inform on people in their communities who are suspected of being Islamic State sympathizers. The Taliban in recent days also arrested six clerics in three districts of Zabul, suspecting them of being on Islamic State’s payroll, a Taliban fighter in the province said.

Zabul province, a region of inhospitable desert and rugged scrubland, is one of the poorest in the country and has long been home to militant figures who have staged potent insurgencies.

This is where the Taliban’s own founder Mullah Omar lived for more than a decade after the U.S. invasion toppled the regime in 2001, according to Taliban officials and American researchers. Mullah Omar lived near an American base until he died in 2013.

The Taliban leadership didn’t reveal until 2015 that Mullah Omar had died. The admission caused a rift between a prominent commander, Mullah Dadullah, and the movement’s new leader, Mullah Akhtar Mansour. Both men have since been killed.

Mullah Dadullah based himself out of Zabul where he hosted hundreds of Islamic State fighters and struck an alliance with militants from the Islamic Movement of Uzbekistan, another radical group that also pledged allegiance to ISKP. The alliance turned Zabul into one of Islamic State’s first strongholds in Afghanistan.

Taliban officers and villagers gathered to pray on a recent evening in Zabul province.

Mullah Dadullah was killed by the Taliban that year in a bloody offensive that uprooted Islamic State’s base in Zabul. One of the few ISKP sympathizers who escaped, according to Zabul residents, was Mullah Ibrahim.

After joining another faction of Islamic State in the northwestern city of Herat, Mullah Ibrahim returned to Zabul last year and eventually settled in the tiny hamlet of Makrak. The 20 residing families, unfamiliar with his past allegiances, offered him a cut of the village’s pomegranate profits for a year’s employment at the mosque.

“We needed a mullah. We didn’t know he was with Islamic State until after his death,” said Yamatullah, a resident of the village who only uses one name. “He was a knowledgeable scholar.”

Mullah Ibrahim had only worked there a few months when his killers tracked him down.

“He must have done something,” said Sada Gul, one of the men who witnessed the murder. Mullah Ibrahim’s wife and children left the village after he was killed.

“Islamic State is trying to regroup,” said a resident of the neighboring district of Dey Chopan. “That’s why the Taliban are trying to kill them.”

Write to Sune Engel Rasmussen at sune.rasmussen@wsj.com