The UK charity Save the Children has temporarily suspended its programmes in Afghanistan after an attack on its offices in the city of Jalalabad.
Three members of staff and one soldier were killed in a suicide attack and siege of the building by Islamic State militants.
Some 46 people in the building, many of whom hid in a safe room, were rescued.
Save the Children said it was "shocked and appalled at the violence" carried out against "dedicated humanitarians".
The charity said that while it had temporarily suspended its operations across the country it remained "fully committed to helping the most deprived children of Afghanistan".
How did the attack unfold?
The attack started at about 09:10 local time (04:40 GMT) on Wednesday when a suicide bomber detonated a vehicle explosive at the entrance to the Save the Children compound.
One eyewitness spoke of seeing a gunman use a rocket-propelled grenade (RPG) to hit the gate.
"An explosion rocked the area and right after that children and people started running away," resident Ghulam Nabi told Reuters news agency. "I saw a vehicle catch fire and then a gunfight started."
One of those who hid in a safe room told the BBC that he did so with 45 others. "One of the gunmen was outside the door," he said. "We managed to escape through a back exit."
Afghan commandos joined police to fight the militants in a battle which continued into the evening, long after officials said it had ended.
In an update, the provincial governor's spokesman said five attackers were involved, all of whom were killed - revising earlier reports that there were six attackers.
The Islamic State group said in a message on its news outlet Amaq that it had targeted "British, Swedish and Afghan institutions in Jalalabad".
Taliban militants stormed the luxury Intercontinental Hotel in Kabul over the weekend, killing at least 22 people, many of them foreigners.
What has Save the Children said?
In its latest statement, Save the Children said it was with "profound sadness" it confirmed the loss of three members of its staff. Four were injured.
In an earlier statement, the charity announced it was temporarily suspending its work and closing its offices across the country.
But it said it remained "committed to resuming our operations and lifesaving work as quickly as possible, as soon as we can be assured that it is safe to do so".
Save the Children has been working in Afghanistan since 1976, and has been running programmes across 16 provinces in Afghanistan.
According to the aid agency, more than 700,000 children in Afghanistan have been reached over the years through its efforts.
Why are charities targeted in Afghanistan?
By Asif Maroof, BBC Afghan service
Afghanistan is one of the world's most dangerous countries for aid workers, who are under constant threat of attack by insurgents. Such attacks have become much more common in recent years.
Tens of thousands of aid workers used to be employed either permanently or on projects, but that number has plummeted since foreign combat forces pulled out in 2014.
Now the Afghan government says that just over 900 foreign aid workers remain, mainly in Kabul and other large cities.
According to the Aid Worker Security Database from 1997 to the end of 2014, more than 450 aid workers were killed, assaulted or kidnapped.
The Islamic State group sees aid workers as representatives of the West and has carried out deadly attacks on them. The Taliban do too, but often try to use people they seize in prisoner exchanges. Then there are criminal groups who kidnap for ransom.
The decline in aid work means fewer Afghans can now rely on the vital services charities provide, particularly in remote areas where the government is absent.
What of other attacks on charities?
The Red Cross announced in October that it was drastically reducing its presence in Afghanistan after seven of its staff were killed in attacks in 2017.
Attacks over the years include:
- May 2017: Attackers storm a guesthouse run by a Swedish NGO, Operation Mercy, killing a German woman and Afghan guard
- July 2014: Gunmen shoot dead two Finnish women working for a Christian aid charity, the International Assistance Mission (IAM), in the western city of Herat
- October 2010: Kidnapped UK aid worker Linda Norgrove is killed in a rescue attempt
- August 2010: 10 members of an eye care team working for IAM are shot dead in Nuristan province
Additionally, the US bombing of a Médecins Sans Frontières hospital in Kunduz in October 2015 killed 22 people.