A suicide car bomber struck an army base in Afghanistan on Sunday killing at least 30 security personnel, officials said, in one of the deadliest attacks targeting government forces in months.

The attack occurred on the outskirts of Ghazni city, capital of the eastern province of Ghazni, which has seen regular fighting between the Taliban and government forces.

It came as the Afghan government and Taliban are engaged in peace talks, but a top official warned that such attacks have the potential to "harm the peace process" as violence continues to surge across the country.

"Thirty bodies and 24 wounded people have been brought to hospital. All of them are security personnel," Baz Mohammad Hemat, director of Ghazni hospital, told AFP.

Security personnel near the army base hit by a suicide bomber on the outskirts of Ghazni
Security personnel near the army base hit by a suicide bomber on the outskirts of Ghazni AFP / STR

Interior ministry spokesman Tariq Arian said a suicide bomber had detonated a vehicle full of explosives.

"The bomber drove a Humvee vehicle right inside the base and detonated it," Ghazni governor spokesman Wahidullah Jumazada told AFP.

The base is located on a vast swath of arid land surrounded by mountains.

Video footage showed military ambulances taking the dead and wounded to hospitals and cranes deployed to remove the debris from the site of the attack in the base.

The ministry of defence gave a toll of 10 security personnel killed and seven wounded. The ministry is known to downplay tolls in attacks against its forces.

Map locating Ghazni in Afghanistan
Map locating Ghazni in Afghanistan AFP / STAFF

No group has so far claimed the attack, and the Taliban who are fighting government forces have often not commented on deadly strikes since the peace talks commenced on September 12.

The Taliban have primarily targeted government forces in rural areas since signing a separate deal with Washington in February that paved the way for the withdrawal of foreign forces by May 2021.

The Pentagon said earlier this month that it would soon pull out about 2,000 troops from Afghanistan, speeding up the timeline of a full withdrawal.

An Afghan soldier with a rocket-propelled grenade launcher near the site of the suicide car bomb attack in Ghazni
An Afghan soldier with a rocket-propelled grenade launcher near the site of the suicide car bomb attack in Ghazni AFP / STR

"Such terrorist attacks will create an atmosphere of fear, terror and pessimism among the Afghan people and will harm the peace process," said Abdullah Abdullah, who is leading the overall peace process in Afghanistan.

"The increase in violence is not acceptable to people... and runs against the peace process, negotiations and reconciliation."

The Ghazni attack comes just days after two bombs killed 14 people in the historic city of Bamiyan, ending years of calm in the isolated town famous for its ancient Buddhist heritage.

In another suicide car bomb attack on Sunday, one civilian was killed and 20 others wounded in the southern province of Zabul, police said.

Sunday's bombings marked the latest carnage in Afghanistan, where violence has surged since the start of peace talks in Doha.

Negotiations had been bogged down by disputes on the agenda, the basic framework of discussions and religious interpretations, but agreement has now been reached on all these issues, according to sources close to the talks.

However, a spokesman for the government negotiating team, Nader Nadery, said on Twitter late on Saturday that while there had been progress on these issues an overall agreement was still to be finalised.

The Ghazni attack, like previous assaults, shows a "Taliban tactic to use violence" to pressure the government into submitting to the insurgent group's demands, Afghan security analyst Atiullah Amarkhail told AFP.

"The attack could carry a message that the Taliban are capable of striking at well protected bases should the government not accept their demands," he said.

"The increased violence would also push the international community to put more pressure on the Afghan government for a political settlement with the Taliban... I believe the Taliban are aiming for that."

US Secretary of State Mike Pompeo had called for "expedited discussions" during a visit to Doha last week where he met negotiators from both sides.

In recent weeks, violence has also surged in Kabul with more than 50 people killed in two assaults on educational centres and a rocket attack.

The three Kabul attacks were claimed by the Islamic State group, but Afghan officials blamed the Taliban -- who denied any involvement.