Taliban insurgents attacked the Afghan election commission's heavily-fortified headquarters in Kabul on Saturday, one week ahead of voting and after a series of bloody militant assaults in the city.
Quick-response commando teams rushed to hunt down the attackers, who unleashed rockets and gunfire from a nearby building.
"I can confirm an attack at the IEC (Independent Election Commission) headquarters," IEC spokesman Noor Mohammad Noor told AFP.
"We heard two explosions inside the IEC compound, the sound of firing is still ongoing, but people are safe and are in (reinforced) safe rooms."
A Taliban spokesman said via a recognised Twitter account that the insurgent group was behind the attack.
There were no immediate reports of casualties in the on-going fighting between militants and security forces.
On Tuesday, Taliban suicide attackers stormed a separate IEC office in Kabul, killing five people.
The Taliban have vowed a campaign of violence to disrupt the elections on April 5, urging their fighters to attack polling staff, voters and security forces in the run-up to election day.
Interior ministry spokesman Sediq Sediqqi said: "Initial information shows that three or four attackers have occupied a building and are firing on the IEC office."
The venue had been due to hold a press conference shortly after the attack to announce details on security preparations for the election.
- Attacks rise before vote -
The vote to choose a successor to President Hamid Karzai, barred constitutionally from seeking a third term, will be Afghanistan's first-ever democratic handover of power.
But there are fears of a repeat of the bloodshed that marred the 2004 and 2009 elections, when the Taliban displayed their opposition to the US-backed polls through violence.
Another bloody election would damage claims by international donors that the expensive intervention in Afghanistan has made progress in establishing a functioning state.
Some Kabul restaurants and shops popular with foreigners have closed for the election period due to the risk of attack.
Saturday's assault came the day after Taliban attackers raided a Kabul guesthouse used by a US anti-landmine charity, killing two people.
The guesthouse attack was the fourth this year in Kabul targeting foreigners or places where foreigners congregate.
Last Thursday four Taliban gunmen smuggled pistols into Kabul's high-security Serena hotel and shot dead nine people including four foreigners.
The victims also included Agence France-Presse journalist Sardar Ahmad, his wife and two of their three children.
Those attacks followed the daylight shooting of a Swedish radio journalist and an assault in January on a Lebanese restaurant that killed 21 people including 13 foreigners.
Presidential candidates have been holding election rallies across the country before the last day of campaigning on Wednesday.
Former World Bank economist Ashraf Ghani, Abdullah Abdullah, who came second in 2009, and former foreign minister Zalmai Rassoul are the leading contenders in the eight-man race.
On Saturday, a telephone poll of 3,200 voters in all 34 provinces put Ghani on 27 percent, Abdullah on 25 percent and Rassoul on 8 percent.
ATR, the Kabul-based research group which took the poll, said that 30 percent of voters remained undecided.