Afghan security forces in Kabul have shot dead a suicide bomber before he was able to blow himself up outside the headquarters of Afghanistan's National Directorate of Security (NDS) on Sunday morning, during which there were three further attacks across the country.

Security officials said a soldier guarding the entrance to the NDS headquarters shot the man after he refused to get out of his car near the heavily fortified Wazir Akbar Khan area of the capital.

Elsewhere in eastern Afghanistan, three separate suicide attacks in two provinces killed three soldiers and injured seven people. The Taliban has claimed responsibility for the attacks but said it was unaware of the incident in Kabul.

The attempted attack in Kabul is the second time in two months that suicide bombers have targeted the NDS. In January six men attacked the building, killing two security guards. That followed a failed attempt to assassinate the head of the organisation in December 2012.

At approximately 9am on Sunday morning, a Toyota Prado approached the NDS centre, which is close to numerous diplomatic missions, government ministries and military bases.

"One of the guards at the gate [became suspicious] and the soldier told [the man] to get out of the car. He didn't listen, and the soldier shot the suicide bomber," Daoud Amin, the deputy provincial police chief for Kabul said. Explosives were found on the man's body and inside his car, he added.

Earlier reports that up to three suicide bombers had been in the car, and one had escaped and was being pursued by police, were denied by Amin.

The attempted attack in Kabul appeared to coincide with three suicide attacks in eastern Afghanistan, close to the border with Pakistan.

At around 7am in eastern Nangarhar province, a suicide bomber in a car killed two soldiers and injured three people when he blew himself up in the provincial capital Jalalabad, a spokesman for the area said.

At around the same time in the Pol-e-Alam district of neighbouring Logar province, a suicide bomber in a small minibus detonated his device, wounding three policemen.

Some two hours later, in Logar's Baraki Barak district, a suicide bomber, who was trying to enter the office of the district government on foot, blew himself up, wounding a security guard, an official said.

A Taliban spokesman, Zabiullah Mujahed, confirmed the group had been behind the attacks in Logar and Nangarhar, but was not aware of the attempted attack in Kabul.

The last major attack in the capital involved several suicide bombers and gunmen who launched an eight-hour assault on the traffic police headquarters a month ago, killing three officers.