A powerful Taliban truck bomb struck the German consulate in Afghanistan's northern Mazar-i-Sharif city, killing four people and wounding more than 100 in a major militant assault in the strife-torn country.
Four dead - two civilians and two unidentified bodies - were brought to the Balkh hospital and around 115 people were wounded, Dr Noor Mohammad Faiz told AP.
"The blast was loud and powerful, which shattered windows, and many civilians were wounded inside their homes," he said.
The Taliban called it a "revenge attack" for recent US airstrikes in the volatile province of Kunduz earlier this month that left up to 32 civilians dead.
Sporadic gunfire rattled the usually tranquil city after the huge explosion on Thursday, which smashed windows of nearby shops and left terrified local residents fleeing for cover.
German officials in Kabul and Mazar-i-Sharif were not immediately reachable for comment.
"The suicide attacker rammed his explosives-laden car into the wall of German consulate in the city," local police chief Sayed Kamal Sadat told AFP.
Afghan special forces cordoned off the area as helicopters were seen flying over the consulate 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 jumpstart stalled peace negotiations.
Taliban spokesman Zabihullah Mujahid said the "martyrdom attack" on the German consulate had left "tens of invaders" dead. The insurgents are routinely known to exaggerate battlefield claims.
Mujahid said the assault was in retaliation for American air strikes in Kunduz.
Meanwhile, 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, after a Taliban assault left two American soldiers and three Afghan special forces soldiers dead near Kunduz city.
The strikes triggered impassioned protests in Kunduz city, with the victims' relatives parading mutilated bodies of dead children piled into open trucks through the streets.
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.
Afghanistan's worsening conflict has prompted US forces to step up airstrikes to support their struggling Afghan counterparts, fuelling the perception that they are increasingly being drawn back into the conflict.
The latest attack in Mazar-i-Sharif comes just two days after a bitter US presidential election.
Afghanistan got scarcely a passing mention in the election campaign - even though the situation there will be an urgent matter for President-elect Donald Trump, who is set to inherit America's longest war with no end in sight.