Image copyright AP Image caption Soldiers secure the scene of the bus attack in Kabul

At least 20 people - including 12 members of a landmine-clearing team - have been killed in a series of attacks blamed on the Taliban.

President Ashraf Ghani said the attack on the de-miners in Helmand province was the work of Afghanistan's enemies.

Separately, a suicide bomber targeted a bus in the capital, Kabul, killing seven soldiers. Elsewhere in the city, a top court official was shot dead.

The Taliban has intensified attacks as foreign troops prepare to withdraw.

With this cascade of attacks the Taliban seem intent on humiliating, and trying to undermine, the Nato force that's about to scale down to just 13,000 - less than a tenth of what it was at its height, BBC South Asia editor Charles Haviland reports.

They are also demoralising Afghanistan's own security forces, who have taken on most frontline responsibilities and have lost more than 9,000 men in two years, he adds.

The landmine-clearing team was attacked near the former British base of Camp Bastion - reportedly by gunmen riding motorcycles.

Troops later fought the attackers, killing four and capturing three, police spokesman Farid Ahmad Obaid told reporters.

Afghanistan's minefields

Image copyright EPA

Mines killed or injured an average of 39 civilians each month during 2013

Nearly one million Afghans (3% of the population) live within 500m (546yds) of landmine-contaminated areas

Minefields hinder development projects such as road construction

As many as 640,000 mines have been laid since Soviet invasion of 1979

Between 1988 and 2013, nearly 226,000 planted mines were destroyed by an NGO, Halo Afghanistan

Sources: Mine Action Programme in Afghanistan, Halo Trust

After decades of war, Afghanistan remains one of the most heavily mined nations in the world, the BBC's Mike Wooldridge reports from Kabul.

Our correspondent says de-miners are supposed to be accepted as neutral by all parties to the conflict, as their work seeks to reduce danger to civilians.

However, they are frequently the target of attacks. In April, Taliban gunmen killed 12 of them in Logar province.

Image copyright EPA Image caption Militants targeted a Nato convoy close to the Bagram air base on Friday night, killing two soldiers

Meanwhile in Kabul, a suicide bomber blew himself next to an army bus, killing at least seven people. The vehicle burst into flames.

In a similar attack two days ago, a bomber travelling on foot detonated his explosives beside a bus full of soldiers, killing six of them.

Earlier on Saturday, Atiqullah Rawoofi, the head of the Afghan Supreme Court's secretariat, was shot dead by two men on a motorbike as he walked from his home to his car.

On Friday, two US soldiers died when insurgents attacked a convoy close to the main international base north of Kabul.

The deaths bring to 65 the number of international troops killed in Afghanistan during 2014, 50 of them from the US.

Image copyright EPA Image caption German Defence Minister Ursula von der Leyen visiting troops in Mazar-e-Sharif

On a visit to the north Afghan city of Mazar-e-Sharif, German Defence Minister Ursula von der Leyen said Afghans were "prepared and determined to take over responsibility for security in their country".

But in view of the Taliban threat, foreign forces were "determined to stand by the Afghan security forces and to counsel them on how to counter this threat", she added.

Our correspondent says the recent violence has provoked fresh debate about how the Taliban have been able to evade the apparently rigorous security in the capital.

Last month, Kabul's police chief resigned following several attacks on foreigners and locals in the city.

President Ghani, who took power in September, has vowed to bring peace after decades of conflict.