A powerful Taliban truck bomb struck the German consulate in the northern Afghan city of Mazar-i-Sharif late Thursday, killing at least two people and wounding 32 others, officials said.
The Taliban called it a "revenge attack" for a U.S. airstrike in the volatile province of Kunduz earlier this month that left up to 32 civilians dead.
"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.
Government spokesman Munir Farhad confirmed the attack.
At least two people were killed and 60 wounded including locals in Thursday's attack, some critically, the Twitter feed of a journalist, Bilal Sarwary, quoted a local doctor as saying. A nearby market selling carpets was set alight, Sarwary added.
There was no immediate report on whether consulate staff were among the dead or wounded.
The consulate is located in a large building close to the Blue Mosque in the centre of Mazar-i-Sharif. It is surrounded by high walls and heavily secured.
NATO forces have a large base on the edge of the city.
Germany, which is responsible for the NATO presence in northern Afghanistan, has about 1,000 soldiers at the base, with another 1,000 troops coming from 20 partner countries.
A spokesman for NATO forces in the area said troops from the North Atlantic alliance had been sent to the scene.
The explosion occurred at around 2305 local time, a spokesman for the German military joint forces command in Potsdam said.
The German foreign ministry had no immediate comment.
Last Thursday's air strikes in Kunduz, in which dozens of Afghan civilians were killed, were called in when U.S. and local troops came under heavy fire during an operation in which two American service members also died.