Gunmen stormed an office of the Save the Children aid agency in Afghanistan's eastern city of Jalalabad on Wednesday and battled security forces surrounding the building, with at least three people killed and 20 wounded, officials said.
Islamic State claimed responsibility for the attack, which began with a suicide car bomb outside the office at about 9am local time, followed by gunmen entering the compound.
"There was a blast and the target was Save the Children," said Attaullah Khogyani, a provincial government spokesman. "Attackers entered the compound and the fight is going on."
Some witnesses said there appeared to have been at least four attackers in police uniform, a commonly used tactic, but there was no immediate official confirmation.
It was not clear if two of the dead were attackers or civilians, the spokesman said. A member of the security forces was also killed.
"An explosion rocked the area and right after that children and people started running away," said Ghulam Nabi, who was nearby when the bomb exploded. "I saw a vehicle catch fire and then a gunfight started."
Islamic State said the attack targeted British, Swedish and Afghan government institutions in a statement on its Amaq news agency. Save the Children was founded in Britain and a Swedish aid group office and a building of the Afghan Department of Women's Affairs are near the compound.
The attack underlines how difficult operating in Afghanistan has become for humanitarian aid bodies, which have faced heavy pressure from armed groups and kidnappers.
Save the Children, which says it reaches almost 1.4 million children in Afghanistan, said it had suspended its operations temporarily and closed its offices in Afghanistan.
"Our primary concern remains to secure the safety of all of our staff," a group representative said in an emailed statement.
"We remain 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."
In October, the Red Cross said it was drastically reducing operations in Afghanistan following attacks that killed seven of its staff.
"An attack against an organisation that helps children is outrageous. Civilians and aid workers must not be targeted," said Monica Zanarelli, head of the Red Cross delegation in Afghanistan, in response to Wednesday's attack.
"Increased violence has made operating in Afghanistan increasingly difficult for many organisations."
Plumes of black smoke rose from the area as the surviving gunmen battled special forces.
A police officer said at least one attacker had blown himself up in the initial suicide assault and another had been killed. Schoolchildren and residents fled as Afghan special forces arrived to engage the militants.
By late afternoon, Khogyani said one attacker was still holding out, battling the security forces, and 45 people had taken refuge in a fortified "safe room" in the compound.
Jalalabad is the capital of Nangarhar province on the porous border with Pakistan. The province has become a stronghold of Islamic State, which has grown into one of Afghanistan's most dangerous militant groups since it appeared around the beginning of 2015.
Backed by intensive US air strikes, Afghan forces have claimed growing success against the Taliban and other militant groups, including Islamic State, but militant attacks on civilian targets have continued, causing heavy casualties.
The attack in Jalalabad came just days after Taliban militants attacked the Hotel Intercontinental in the capital, Kabul, killing at least 20 people, including 13 foreigners.