A D.C. police officer has been injured and a man shot in the head during an altercation in Northwest Washington.

Police said they responded about 11 p.m. Tuesday to the 6400 block of 13th Street NW for a report from a woman who said that a man was harassing her, said Officer Tisha Gant. The woman had a court order against the man ordering him to stay away from her, police said.

Police said that when they arrived on the scene, the man had a knife an attacked an officer. An officer fired, striking the man in the temple.

Both the suspect and the officer who was attacked were taken to a hospital. The officer was treated and released, and the 47-year-old remained in the hospital in serious condition, police said.