* Ghani not in building, but family members at home
* Taliban claims responsibility
* Kabul on high alert ahead of April 5 election (Updates death toll, adds another attack)
By Hamid Shalizi and Maria Golovnina
KABUL, March 25 (Reuters) - Taliban suicide bombers and gunmen attacked an election commission office in Kabul next to the home of presidential candidate Ashraf Ghani on Tuesday, rattling nerves in the Afghan capital less than two weeks before an important election.
Kabul is on high alert ahead of the April 5 presidential vote that Taliban insurgents have threatened to derail with a campaign of bombings and assassinations.
Ghani, a former World Bank official and frontrunner in the vote, was not at home at the time of the attack, for which the Taliban claimed responsibility.
Security forces cordoned off the area in western Kabul and besieged the building for several hours as militants returned fire from their positions.
"The operation is over," the deputy interior minister, General Ayoub Salangi, told Reuters. "Five enemies were killed and all election workers trapped inside were rescued."
Five more people including two policemen and a provincial council candidate were killed in the attack, the interior ministry said.
Several other attacks took place across Afghanistan on Tuesday, including a suicide bomb assault on a traditional horseback "Buzkashi" match in the northern city of Kunduz in which at least six civilians were killed.
Security is tight in Kabul ahead of the election, which, if successful, will mark Afghanistan's first democratic transfer of power. Nine people were killed last week in a brazen attack on a luxury hotel in the capital.
The United Nations, which is advising Afghan election officials, has told staff to exercise caution and only authorise essential programmes.
President Hamid Karzai is barred from running for another term after 12 years in power but is widely expected to retain his influence through officials loyal to him.
Police initially said militants had attacked Ghani's house itself but later Ghani's campaign aide said the assault targeted an adjacent building. "The attack was on an election office next to Dr Ashraf Ghani's house," said the aide. "His house was also hit by the attackers."
Ghani, in a Twitter post after the attack, said: "Terrorists cannot deter us from our cause with their cowardly attacks. My family is safe. Thank you to those of you who prayed for us."
How the election unfolds may give an idea of how stable Afghanistan will be in months to come. The NATO-led force, which has been reinforcing security since the Taliban were driven from power in 2001, is preparing to pull out most troops this year.
The Islamist Taliban movement has ordered its fighters to go all out to disrupt the vote and threatened to kill anyone who takes part in what it calls a Western-backed sham.
"We do believe that the insurgency has a strong interest in trying to derail the elections if they can and therefore we hope that the Afghan people will be resilient to these kinds of incidents, tragic as they are," said EU ambassador Franz-Michael Mellbin.
Afghans are used to almost daily attacks and few believe the vote could be derailed altogether. Nonetheless, any noticeable increase in violence could be enough to scare people away from polling stations.
"There was some speculation about what (the Taliban's) attitude would be during the election...whether they were just threatening, or would really execute this threat," said a Western diplomat.
"It turns out they have really decided to implement this threat."
Also on Tuesday, three suicide bombers stormed a branch of Kabulbank, one of Afghanistan's biggest banks, in the eastern province of Kunar, killing at least three security guards and injuring two bank workers, police said.
In the southern province of Helmand, a gunman killed a policewoman, police said.
Asked about the Kunduz attack, General Mustafa Andarabi, the local police chief, said: "Their real target was to create fear among people days before the elections." (Additional reporting by Mirwais Harooni and Jessica Donati in KABUL, Folad Hamdard in KUNDUZ and Mohammad Stanekzai in HELMAND; Writing by Maria Golovnina in KABUL; Editing by Raissa Kasolowsky)