An Afghan official says gunmen have stormed a government compound in a northern city, killing a policeman and wounding several people.

Police official Mohammadullah, who like most Afghans uses only one name, says militants stormed the compound with the chief prosecutor's office in Mazar-i-Sharif on Thursday morning and were exchanging fire with the police.

Insurgent attacks are rare in the economically stable and developed Mazar-i-Sharif, the provincial capital of Balkh province.

Sher Jan Durani, spokesman for the provincial police chief, says the siege began after the "terrorists entered the compound." He says police have surrounded it and that now "both sides are exchanging fire."

He says most of the employees and prosecutors have been rescued by police but that some have been wounded by in the shootout.