Gunmen attacked an office of the education department in the eastern Afghan city of Jalalabad on Wednesday and were battling security forces, officials said.