KABUL, Afghanistan -- Germany’s consulate in northern Afghanistan was attacked late Thursday when a suicide car bomber rammed the compound, a senior police official said.

The car exploded at the gate of the consulate in Mazar-i-Sharif city, destroying the gate and wall around 11.10 p.m. local time, said Abdul Raziq Qaderi, head of security for Balkh province. He said three police were wounded.

“Police have surrounded the area and our forces are inside the compound,” he said.

Get Breaking News Delivered to Your Inbox

The Taliban issued a statement saying they had sent suicide attackers to the consulate.

Sher Jan Durrani, spokesman for the police chief of Balkh province, said early Friday that a gun battle was going on at the consulate.

The German Foreign Ministry said in a statement there was an “armed attack” on the consulate but didn’t specify the nature of the attack or mention any casualties.

The statement said there had been fighting outside and on the grounds of the consulate and that Afghan security forces and troops from the international Resolute Support mission were at the scene.

Mazar-i-Sharif is the capital of Balkh province and one of the most important cities in the country. Residents in the city reported hearing a huge explosion near the consulate that shattered windows in buildings nearby.

Germany has 983 soldiers stationed in Afghanistan, most of them in Balkh, as part of NATO’s Resolute Support mission.

The Taliban’s insurgency has spread from their southern heartland across the country in the past two years.

The Taliban statement from spokesman Zabihullah Mujahid said the attack was retaliation for recent airstrikes in the northern city of Kunduz, capital of the province of the same name.

A U.S. airstrike earlier this month killed dozens of people, including women and children, and is under investigation.