Death toll rises to 20 after attack against the Kabul political office of Amrullah Saleh who was safely evacuated.

The death toll from an attack targeting the Kabul office of the Afghan president’s running mate and former chief of the intelligence service has climbed to at least 20 people, according to an official.

Nasrat Rahimi, an interior ministry spokesman, said on Monday that about 50 other people were wounded in the attack against the Green Trend party headquarters the previous day in Afghanistan’s capital.

He added that several gunmen were killed by security forces during an hours-long operation which included a gun battle with the attackers who were holed up inside the building.

The attackers’ potential target, vice presidential candidate and former intelligence chief Amrullah Saleh, was “evacuated from the building and moved to a safe location”, Rahimi said.

About 85 other civilians were also rescued from inside.

“We heard a lot of commotion and yelling right before the first bomb went off,” Jan Gul, a 46-year-old taxi driver, told Al Jazeera.

“I was half way up the street at Shaheed Square. I counted about seven blasts over a 30- to 60-minute period with a lot of gunfire,” he said.

Another eyewitness, Muhammad Hussain, a 35-year-old English teacher, told Al Jazeera that he saw three or four attackers inside the building during the attack.

“I was at Shaheed square when I heard a massive explosion. We started to see kids, women and men running in our direction – some of them were injured and shouting for help,” he said.

“Some of us in the area disregarded police orders and went around them to help the injured. When we reached the front of the office, another blast went off right next to Saleh’s guards,” Hussain said.

“I entered the compound to help and there were bodies everywhere. I saw three or four insurgents inside the basement of the compound and rushed to alert security. They [the security] grabbed Saleh at that point and rushed him out the compound.”

Another eyewitness, 16-year-old Irfan, told Al Jazeera that the gun battle caused panic.

“I was walking directly in front of Saleh’s office when the first explosion went off. It knocked me to the ground. As I got up to run away, I saw many injured and body parts laying on the road. A gun battle broke out as everyone ran away. Everyone was in a panic, including the police,” he said.

The violence underscored the risks facing the presidential election [Mohammad Ismail/Reuters]

There was no immediate claim of responsibility, but both the Taliban and the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) armed groups have previously carried out attacks in Kabul.

The violence underscored the risks facing the presidential election, which is scheduled for September 28 but has already been delayed twice this year.

Saleh is an uncompromising opponent of the Taliban and other hardline groups.

President Ashraf Ghani, Saleh and more than a dozen other Afghan politicians launched their presidential campaign on Sunday.

Ghani said in a tweet: “My brother, true son of the Afghan soil and first VP candidate of my electoral team, Amrullah Saleh has survived a complex attack by enemies of the state. We are relieved and thank the almighty that the attack has failed.”

Earlier on Sunday, a buoyant Ghani kicked off his campaign by insisting “peace is coming” and pivotal talks with the Taliban would take place.

War and peace

Ghani is seeking a second term on promises of ending the 18-year war, but has been largely sidelined over the past year as the United States has negotiated directly with the Taliban.

The armed group, who effectively control about half the country, have continued to carry out daily attacks on Afghan security forces with civilians caught in the crossfire.

US envoy Zalmay Khalilzad, who is currently visiting Kabul, has held several rounds of talks with the Taliban in recent months in a bid to end the US’s longest war.

The two sides appear to be closing in on an agreement in which the US would withdraw its forces in return for a pledge from the Taliban to keep the country from being used as a launchpad for global attacks.

The Taliban and the ISIL are sharply divided over ideology and tactics, with the Taliban largely confining its attacks to government targets and Afghan and international security forces.

The two armed groups have fought each other on a number of occasions, and the Taliban is still the larger and more imposing force.

Additional reporting by Mohsin Khan Momand in Kabul