Gunmen attacked an education department office in the eastern Afghan city of Jalalabad and held out against security forces for around four hours before the assault ended with at least 10 people killed, officials said.
As the attack ended, the provincial governor's spokesman Attaullah Khogyani said 10 people were also wounded.
He said there were three attackers, two of whom detonated suicide-bomb vests, while the third was shot by security forces.
Exclusive: Blackwater founder's plan to privatise Afghanistan war
It was the third major attack in less than two weeks in Jalalabad, the main city of Nangarhar province, following a blast that killed a group of Sikhs on 1 July and a second that killed at least 12 people.
With Nato member countries meeting in Brussels, the attacks have underscored the instability in much of Afghanistan where the Nato-led Resolute Support mission has been training and advising Afghan forces.
This year, backed by intensive US air strikes, Afghan forces have claimed success in holding the Taliban back from major cities and US commanders say they have been hitting other militant groups like Isis hard.
World news in pictures
But attacks on civilian targets have continued, causing heavy casualties.
Officials in Washington have said that President Donald Trump has been frustrated with the lack of progress and is expected to launch a review of the U.S. strategy.
There was no immediate claim of responsibility for the attack but both of the other assaults in the city this month were claimed by Isis, which is opposed to both the Western-backed government in Kabul and the Taliban.
The attack on the education department appeared to follow the pattern of previous attacks including an assault on an office of the Save the Children aid group in Jalalabad in January and another on the city accounts office in May.
Nangarhar province, on the porous border with Pakistan, has become an Isis stronghold. It has grown into one of Afghanistan's most dangerous militant groups since it appeared around the beginning of 2015.
On the other side of the country, in the western province of Farah, four people were killed and three wounded when their car set off a roadside bomb as they were travelling to a wedding, a provincial official said.