Afghan security forces investigate the site of the explosion near the German consulate office in Mazar-i-Sharif, Afghanistan Anil Usyan/Reuters

A suicide bomb attack by the Afghan Taliban on a German consulate building in the northern city of Mazar-i-Sharif has killed at least four, with the number of injured in the blast rising to 115.

The massive explosion occurred late in the evening local time when a vehicle, packed with explosives rammed the gates of the German diplomatic building and then detonated, a gunfight followed the bombing.

The Taliban later claimed responsibility for the blast, saying the attack had been made in retaliation for Nato air strikes that killed as many as 30 civilians in the city of Kunduz in October.

Noor Mohammad Faiz from the Balkh hospital in Mazar-i-Sharif, where medical staff were tending to the injured, told the Associated Press four dead had been brought in following the explosion. Two of the bodies are believed to be civilians, with the other two yet to be identified.

Of the 115 wounded in the suicide attack, there is fear that many are woman and children. The explosion targeted the gate of the German diplomatic facility and destroyed its outer wall and surrounding building, which included shops and homes.

A NATO spokesman told Reuters news agency the explosion had caused "massive damage". Some 30 people worked in the diplomatic facility.

The German Foreign Ministry confirmed in a statement that an "armed attack" took place against its consulate. It added that Afghan security forces had engaged in a fire fight. Heavily armed attackers followed up the blast by mounting an assault, battling with Afghan and German security forces late into the night.

"All German employees of the Consulate General are safe and uninjured," a spokesman for the German government said.

It has become a regular tactic of the Taliban to follow an initial suicide attack with an assault by gunmen. The movement's spokesman, Zabihullah Mujahid, said the militants had been sent with "a mission to destroy the German consulate general and kill whoever they found there," according to Reuters.

Afghan security forces and Nato troops investigate at the site of explosion near the German consulate office in Mazar-i-Sharif, Afghanistan Anil Usyan/ Reuters