Taliban militants stormed a court in northern Afghanistan on Monday and killed at least seven people including prosecutors, officials said.