Kabul - The head of Islamic State in Afghanistan, Abdul Hasib, has been killed in an operation led by Afghan special forces in the eastern province of Nangarhar, President Ashraf Ghani said on Sunday.

Hasib, appointed last year after his predecessor Hafiz Saeed Khan died in a US drone strike, is believed to have ordered a series of high-profile attacks including one in March on the main military hospital in Kabul by a group of militants disguised as doctors, a statement said.

Last month, a Pentagon spokesman said Hasib had probably been killed during a raid by US and Afghan special forces in Nangarhar during which two US army Rangers were killed, but there was no confirmation.

The local affiliate of Islamic State, sometimes known as Islamic State Khorasan (IS-K), after an old name for the region that includes Afghanistan, has been active since 2015, fighting both the Taliban as well as Afghan and US forces.

It is believed to maintain links with the main Islamic State movement in Iraq and Syria but has considerable operational independence.

US and Afghan special forces, backed by drone strikes and other air support, have waged a series of operations against IS-K this year, killing dozens of their fighters, mainly in Nangarhar, on the border with Pakistan.

Defeating the group remains one of the top US priorities in Afghanistan and last month the United States dropped its largest non-nuclear device on a network of caves and tunnels used by ISIS in Nangarhar, killing 94 fighters, including four commanders.

Meanwhile, hundreds of Afghan families have fled fighting between the Taliban and government forces near the northern city of Kunduz as the insurgents captured a strategic district soon after launching their annual spring offensive.

The militants began their assault on the Qala-e-Zal district in Kunduz province on Saturday and captured most of it including the district centre.

The attack triggered intense fighting with government forces that sent civilians fleeing toward the provincial capital of Kunduz.

The Norwegian Refugee Council, which has offices in Kunduz, said in a statement that some families were forced to sleep in the open while others moved into the homes of relatives.

"Around 2.30 am Taliban fighters came to our houses and asked us to evacuate. They told us not to make any sound. We were all afraid," said Abdul Karim, 31 who fled Qala-e Zal with his family to Kunduz city, according to the statement.

"Taliban fighters were shooting from one side of our house and the Afghan National Security Forces from the other side. A rocket landed in my garden. My wife told me that if I didn't flee, she would leave the house alone with our two daughters," said another resident, 29-year-old Rahman Gerdi.

Mahfuzullah Akbari, a government spokesman, said Afghan forces retreated from the district to avoid civilian casualties while a Taliban spokesman said in a statement they had forced them out.

"We have launched an operation to retake the district," Akbari told AFP.

On April 28 the Taliban launched their "spring offensive", heralding a surge in fighting as the US tries to craft a new Afghan strategy and NATO considers sending more troops to break the stalemate against the resurgent militants.

The annual spring offensive normally marks the start of the fighting season, though this winter the Taliban continued to battle government forces. An attack on a military base in the neighbouring city of Mazar-i-Sharif left at least 135 soldiers dead earlier last month.

The militants also claimed to have captured Sangin district in the volatile southern province of Helmand in March, underscoring their growing strength.

The Taliban briefly seized Kunduz city in September 2015 in their biggest victory since they were toppled from national power by a US-led invasion in 2001. They were able briefly to re-enter the city centre in October 2016 before once again being pushed back.