The Islamic State group has launched an attack on Afghan security posts, killing 17 soldiers, officials said.
The attack took place on Thursday night in the Dih Bala district of eastern Nangarhar province, according to Ahmad Ali Hazrat, chief of the provincial council.
Mr Hazrat said the militants attacked army posts from three directions and after several hours of heavy fighting, 17 soldiers were dead.
General Doulat Waziri, spokesman for the Ministry of Defence, said 21 IS fighters were killed.
An Afghan provincial official said Taliban forces stormed several more Afghan security posts in eastern Kunar province, killing five police officers.
Governor Waheedullah Kalimzai said the attacks lasted nearly two hours and were apparently co-ordinated but police, aided by other security officials, managed to repel the attackers and drove the insurgents from the area.
He said Taliban fighters used heavy machine guns and explosive devices in the assault.
Mr Kalimzai added that police killed several Taliban fighters, but one officer is missing after the attack.
Afghanistan’s eastern Kunar province borders Pakistan, and insurgent groups have a strong presence in the area.