SILVER SPRING, Md. (AP) — Police in Maryland say an officer has shot a man who barricaded himself inside his ex-girlfriend's home with a knife, entered their 3-year-old son's bedroom and began writing on windows with what appeared to be blood on his fingers.

Montgomery County police said in a statement Tuesday that John Carlos Natera-Perez, also known as Jean Perez, is in grave condition.

Police say officers tried to negotiate with Perez after the boy's mother and her boyfriend escaped the home in Silver Spring on Monday night.

Police say he was seen lighting an object on fire, activating smoke detectors, and the boy could be heard screaming. Tactical team supervisors then went inside for the child's safety, and an officer saw Perez and shot him. The boy was not physically injured.