An attack on the office of Afghan president Ashraf Ghani's running mate Sunday has left at least 20 dead and 50 wounded.

Vice presidential candidate Amrullah Saleh, 46, was quickly evacuated during the earliest phase of the attack when a car bomb went off outside his office in the capital of Kabul. At least four assailants took part in the assault, which reportedly lasted six hours, and they were killed by Afghan security forces. It is unclear if they were affiliated with the Taliban or any other group.

"My brother, true son of the Afghan soil and first VP candidate of my electoral team, @AmrullahSaleh2 has survived a complex attack by enemies of the state," Ghani said on Twitter Sunday. "We are relieved and thank the almighty that attack has failed."

The attack took place hours after Saleh attended the inaugural ceremony of the pair's campaign. Afghan voters go to the polls September 28.

Saleh previously served as the director of the National Directorate of Security, the country's main intelligence agency, and was interior minister from December 2018 to January 2019. He began his political career in the late 1990s as an official for the Northern Alliance, the anti-Taliban group supported by the United States before the founding of the current government.

Photos by TOLOnews’ reporter Sharif Amiri show the aftermath of the attack on political office of vice-presidential candidate Amrullah Saleh. #Afghanistan pic.twitter.com/dWer0aEVyv — TOLOnews (@TOLOnews) July 29, 2019

Saleh, who sustained a minor injury to one arm in the attack, is a vocal critic of the Taliban and has been targeted for assassination in the past. When asked if he feared for his life during a 2009 interview, he said, "Sure, and if they kill me, I have told my family and my friends not to complain about anything, because I have killed many of them with pride, so, I am a very, very legitimate target, very legitimate, because when I stand against them, the desire to stand against them is part of my blood. I believe they are wrong."

Saleh has claimed that Afghan intelligence knew about the whereabouts of Osama bin Laden in Pakistan four years before he was killed and shared that information with Pakistani officials. He said Pakistan's then-president, Pervez Musharraf, was outraged at the insinuation and ignored the tip.

Zalmay Khalilzad, the U.S. special representative leading Taliban peace talks, denounced Sunday's deadly assault.

"The attack on Amrullah Saleh's political party offices was grotesque and a clear act of terrorism," Khalilzad said in a tweet Monday. "We condemn it in the strongest terms. The perpetrators should be brought to justice. We stand with #Afghanistan in the fight against terror."

The United States has been engaged in talks with the Taliban for nearly a year in an attempt to secure a peace agreement, but progress has been limited due to the Taliban's refusal to recognize the legitimacy of the government in Kabul.

Taliban spokesman Sohail Shaheen said Saturday the terror group would not cease its attacks during peace talks or the presidential campaign. Voting was postposted in two provinces during last year's parliamentary elections because of violence.