Afghan security forces stand guard at the site of Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)

KABUL, Afghanistan (AP) — The death toll from an attack against the Kabul office of the Afghan president's running mate and former chief of the intelligence service climbed to at least 20 people on Monday, an official said.

Around 50 other people were wounded in Sunday's attack against the Green Trend party headquarters, which lasted hours and included a gunbattle between security forces and the attackers, who were holed up inside the building, according to Interior Ministry spokesman Nasrat Rahimi.

Several gunmen were killed by the security forces, Rahimi said.

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. Some 85 other civilians were also rescued from inside.

No one immediately claimed responsibility for the attack, but both the Taliban and the Islamic State group are active in the capital and have carried out large-scale attacks in Kabul in the past.

The Taliban, who effectively control half the country at this point, have also been staging near-daily attacks across Afghanistan even as they hold talks with the U.S. about a peaceful resolution to the 18-year war, America's longest conflict. The insurgents however, refuse to directly negotiate with the government, considering it a U.S. puppet.

Sunday marked the first day of the Afghan presidential campaign, with a vote scheduled for the end of September.

After the attack, President Ashraf Ghani tweeted that Saleh was unharmed during the "complex attack" targeting the Green Trend office.

Saleh founded the Green Trend after he was sacked as intelligence chief in 2010 by former President Hamid Karzai. Though a relative newcomer on the Afghan political scene, its focus has been democracy and reform while fiercely opposing the Taliban and their extremist ideology.

Ferdous Faramarz, the spokesman for Kabul's police chief, said the attack started with a suicide car bombing, after which other attackers entered the building and started shooting at security forces.

The explosion from the initial bombing was large enough to be heard throughout the capital.

Ghani is seeking a second term in the Sept. 28 vote on promises of ending the war but has been largely sidelined over the past year amid U.S.-Taliban talks.

U.S. envoy Zalmay Khalilzad, who is currently visiting Kabul, has held several rounds of talks with the Taliban in recent months. The two sides appear to be closing in on an agreement in which the U.S. would withdraw its forces in return for a pledge from the Taliban to keep the country from being used as a launch pad for global attacks.

The Taliban and IS are sharply divided over ideology and tactics, with the Taliban largely confining their attacks to government targets and Afghan and international security forces while IS militants mainly target the country's minority Shiites.

The Taliban and IS have fought each other on a number of occasions, and the Taliban are still the larger and more imposing force.

Afghan security personnel stand guard at the site of a deadly attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
Afghan security forces inspect the aftermath of Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
Afghans walk inside the office of Amrullah Saleh, after Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
Afghan security forces inspect the aftermath of Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
An Afghan security personnel secure the site of a deadly attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
Afghan security personnel secure the site of a deadly attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
Afghan civilians watch damaged buildings in the aftermath of Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
Afghan security personnel secure the site of a deadly attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
Afghan security personnel secure the site of a deadly attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
An Afghan security force member, left, stands guard at the site of Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
An Afghan man searches for the remains of his belongings at his house after Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
Afghan security forces inspect the aftermath of Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
Damaged buildings are seen after Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
Afghan security forces inspect the aftermath of Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
An Afghan woman holds a burnt copy of the Quran inside her house after Sunday's attack in Kabul, Afghanistan, Monday, July 29, 2019. A complex attack against the office of the president's running mate and a former chief of intelligence service Amrullah Saleh on Sunday in the capital Kabul, killed scores of people, an official said on Monday. (AP Photo/Rahmat Gul)
Afghan family flee from near the site of a deadly attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
Afghan security personnel and foreign forces secure the site of an attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
An Afghan family leave the site of a deadly attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)
Afghan security personnel and foreign forces secure the site of an attack in Kabul, Afghanistan, Sunday, July 28, 2019. Afghan officials say the political offices of the president's running mate were hit by a large explosion and stormed by an unknown number of attackers. Nasrat Rahimi, the interior ministry spokesman, said vice-presidential candidate and former intelligence chief Amrullah Saleh survived the attack. (AP Photo/Rahmat Gul)