At least six people were killed and almost 20 others were wounded in a suicide attack in Afghanistan's Jalalabad city near the gate of the finance department. The attackers then stormed the building, trading fire with security officials.
Jalalabad is the capital of restive Nangarhar, which borders Pakistan.
A auto bomb was detonated at the entrance to the state accounts office before a group of about six attackers armed with machine guns and rocket-propelled grenades rushed the building, the officials said.
He also added that the attack left at least forty two people wounded, including civilians, Customs Department workers, and security personnel. No one immediately claimed responsibility for the attack, but both the Taliban and a local Islamic State affiliate reject democratic elections and have targeted them in the past. It was the latest deadly violence to strike Afghanistan as militant groups step up attacks and US-backed Afghan forces intensify air strikes and ground offensives.
Dozens of people have been killed in voter registration centres in recent weeks.
The Taliban and ISIS have made clear their intention of disrupting the elections.
However, the Taliban is now taking part in its annual spring offensive and has launched a number of attacks in recent weeks.
Most have been in Kabul.