MAZAR-I-SHARIF -  The death toll from a powerful Taliban truck bombing at the German consulate in Afghanistan's Mazar-i-Sharif city rose to at least six Friday, with more than 100 others wounded in a major militant assault.

The Taliban said the bombing late Thursday, which tore a massive crater in the road and overturned cars, was a "revenge attack" for US air strikes this month in the volatile province of Kunduz that left 32 civilians dead.

The explosion, followed by sporadic gunfire, reverberated across the usually tranquil northern city, shearing off the facades of nearby buildings and blowing out windows several miles away.

"The suicide attacker rammed his explosives-laden car into the wall of the German consulate," local police chief Sayed Kamal Sadat told AFP.

NATO said its quick reaction force helped evacuate all 21 staff members of the consulate to Camp Marmal, a German base in Mazar-i-Sharif.

The city's hospitals received bodies of six civilians, including two killed by bullets, said local doctor Noor Mohammad Fayez. At least 128 others were wounded, some of them critically and many with shrapnel injuries, he added.

Deputy police chief Abdul Razaq Qadri gave a death toll of seven, including two motorcyclists who were shot dead by German forces close to the consulate after they refused to heed their warning to stop. A suspect had also been detained near the diplomatic mission on Friday morning, Qadri added.

"The consulate building has been heavily damaged," the German foreign ministry said in a statement. "Our sympathies go out to the Afghan injured and their families."

A diplomatic source in Berlin said Foreign Minister Frank-Walter Steinmeier had convened a crisis meeting soon after the attack.

Afghan special forces cordoned off the consulate, previously well-known as Mazar Hotel, after the explosion as helicopters flew over the site and ambulances with wailing sirens rushed to the area.

The carnage underscores worsening insecurity in Afghanistan as Taliban insurgents ramp up nationwide attacks despite repeated government attempts to jump-start stalled peace negotiations.

President Ashraf Ghani condemned the "barbaric" attack, calling it a crime against humanity.

Taliban spokesman Zabihullah Mujahid said the "martyrdom attack" on the consulate had left "tens of invaders" dead. The insurgents routinely exaggerate battlefield claims.

Posting a Google Earth image of the consulate on Twitter, Mujahid said the assault was in retaliation for American air strikes in Kunduz.

US forces conceded last week that its air strikes "very likely" resulted in civilian casualties in Kunduz, pledging a full investigation into the incident.

The strikes killed several children and triggered impassioned protests in Kunduz city, with the victims' relatives parading mutilated bodies of dead children piled into open trucks through the streets.

They came after a Taliban assault left two American soldiers and three Afghan special forces soldiers dead near Kunduz city.

Civilian casualties caused by NATO forces have been one of the most contentious issues in the 15-year campaign against the insurgents, prompting strong public and government criticism.