A suicide bombing near the Pakistani consulate in Afghanistan on Wednesday left at least seven Afghan security forces dead and seven others injured.
The Afghan interior ministry said a suicide bomber detonated a vehicle packed with explosives near the entrance to the consulate in the eastern city of Jalalabad.
Gunmen tried to storm the compound before launching a nearly four-hour-long attack from an adjacent building, described by the interior ministry as an empty guesthouse.
The headmaster of a nearby school that provides vocational training to youth and women said the bombing occurred just before 9 a.m.
"We heard a loud explosion and immediately closed the doors. We are still in the process of trying to account for all the students," the headmaster said.
The interior ministry confirmed that two gunmen were fatally shot after an hours-long gun battle with security forces.
Although witnesses said the attackers tried to enter the Pakistani consulate, Javid Faisal, a spokesman for Afghanistan Chief Executive Abdullah Abdullah, said the guesthouse, an "abandoned" government facility, was the target.
Militants loyal to the Islamic State extremist group claimed responsibility for the blast, according to Reuters. The group is believed to have a growing number of adherents among militants in eastern Afghanistan who have broken with the Taliban in recent months.
Afghan media quoted local officials as saying at least two civilians were injured, but hospital officials did not immediately confirm the reports.
The bombing came 10 days after assailants attacked the Indian consulate in the northern city of Mazar-e-Sharif. A 20-hour battle left at least one member of the Afghan security forces dead and five injured.
Although winter has typically seen lower levels of violence during the 14-year conflict in Afghanistan, insurgents, including the Taliban, have mounted several attacks in recent weeks against Afghan security forces, international officials and civilians.
According to the United Nations, in the first four days of the year, the Taliban claimed responsibility for three attacks in Kabul that killed at least nine people and injured more than 50 others.
The violence has continued despite a renewed push by Afghanistan, Pakistan, the U.S. and China to begin peace talks with the Taliban. Officials from the four countries met in Pakistan this week, although Taliban representatives were not present and many insurgent commanders are said to oppose negotiating with the Kabul government, particularly while the group is showing continued military strength.
Latifi is a special correspondent.