The Red Cross has rarely been hit in the more than 12 years since the Afghan war began in late 2001. Considered one of the most respected agencies in the country, it has good relations with all parties to the conflict, including the Taliban, who allow them to operate in areas under their control.
Interior Ministry spokesman Sediq Sediqi said the three women and four men were safe after police killed an insurgent who was holed up inside the compound. He said one of the male aid workers was lightly wounded.
The other assailant detonated a suicide bomb vest at the building's gate at the beginning of the attack, killing an Afghan security guard who worked for the Red Cross as a staff member, Sediqi said.
Red Cross officials were baffled.
"We are very concerned that the office has been attacked deliberately, knowing that the ICRC is a neutral organization working for almost three decades to provide humanitarian assistance," said Robin Waudo, communications coordinator for the Red Cross in Afghanistan. "We have been here through the different conflicts that happened here and we are known by parties to the conflicts."
"We are surprised just like most that an ICRC office can be attacked when it is known by most parties that we are not a political organization," he said.
The Taliban and other militants have unleashed a wave of bombings and assassinations around the country, testing the ability of the Afghan security forces to respond with reduced help from international forces, who have begun a withdrawal that will see most foreign troops gone by the end of 2014.
The Wednesday attack in the eastern city of Jalalabad was the second major assault against an international organization in five days. Militants launched a similar operation against a U.N.-affiliated group in Kabul last week that killed three people.
There was no immediate claim of responsibility, and it is unclear why insurgents would want to target the Red Cross, which not only carries out humanitarian work around Afghanistan but also is the conduit for families to communicate with detainees taken off the battlefield, including the Taliban.
A spokesman for the Red Cross in Afghanistan, Abdul Hasib Rahimi, said all organization's foreign staff that was inside the compound were safe. He said they were checking to see if any Afghan staffers were there at the time, but noted that local employees had left for the day an hour before the attack. The foreigners live in the compound, he said.
A total of 35 Red Cross staff, including the seven foreigners, work at the facility, he said.
Afghanistan is the site of one of the Red Cross's biggest operations worldwide, with some 1,800 staff working in 17 locations, the organization said.
Sediqi said Afghan forces arrived at the scene of the attack shortly after the suicide bombing at the door, which cleared the way for the other attacker to enter.
"As a result of the shooting exchange, the gunman was killed and all seven foreigners who were inside the building were rescued safely," he said. "Right now the security situation is under control."
The Red Cross warned last month that security was deteriorating across Afghanistan as militants flood the battlefield and conduct attacks in what could be the most important spring fighting season of the nearly 12-year-old war.
The violence came five days after Taliban gunmen backed by a suicide car bomber attacked the Kabul offices of the International Organization for Migration, killing two Afghan civilians and a police officer. The assault sparked an hours-long street battle and left another 17 wounded, including seven IOM staff members.
The IOM is a U.N.-affiliated agency assisting returning Afghan migrants as well as those displaced by fighting.
The Taliban quickly claimed responsibility for the attack on the IOM guest house in an upscale neighborhood of Kabul.
There have been concerns that the Taliban would increasingly strike organizations such as the United Nations mission in Afghanistan after the international body said the insurgents were committing war crimes by targeting government officials. There have been a number of acrimonious exchanges between the Taliban and the U.N. over the increasing number civilian casualties.
This year is crucial for Afghanistan, as the U.S.-led coalition is expected to hand over most security responsibilities in the country to its own security forces in the late spring. Foreign military forces are then expected to begin a withdrawal to be completed by the end of the year.
Earlier, seven insurgents wearing police uniforms and bomb-laden vests attacked a government compound in Panjshir, a usually secure province in eastern Afghanistan. One police officer was killed and another was wounded. The Taliban claimed responsibility.
While attacks have grown more frequent in many parts of Afghanistan, Wednesday's violence was of note because it took place in in eastern Panjshir province, a normally peaceful area in a valley that was the heart of the anti-Taliban resistance until the U.S. invasion in late 2001.
Governor Kramuddin Karim said the attackers targeted the government complex in the provincial capital of Bazarak, and all seven militants were killed.
Taliban spokesman Qari Yousef Ahmadi claimed responsibility for the attack in an email to journalists.
Provincial police chief Qasim Jangalbagh said the insurgents were wearing police uniforms. Three of the attackers blew themselves up and four were killed by police during the assault. The government complex was empty because of the early hour, Jangalbagh said.
Jangalbagh said a station wagon with 20 kilograms (45 pounds) of explosives that the insurgents were driving did not blow up. He added that one of the seven insurgents managed to flee the scene but later blew himself up.
Associated Press writers Amir Shah in Kabul and Rahmat Gul in Jalalabad, Afghanistan, contributed to this report.