Attackers have detonated explosives before storming the offices of the Save the Children charity in the eastern Afghan city of Jalalabad.
At least two people have been killed and 12 injured, officials say. It is believed about 50 staff were in the building at the time.
The Islamic State group has said three of its fighters are behind the attack, which is said to have now ended.
Save the Children has temporarily suspended all of its Afghan programmes.
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, Attaullah Khogyani, a spokesman for the governor of Nangarhar province, told the BBC.
An eyewitness who was inside the compound at the time told AFP news agency that he saw a gunman hitting the main gate with a rocket-propelled grenade (RPG).