A Texas cop shot and killed a woman he was sent out to help, accidentally hitting her when he opened fire at a charging pooch, police said.

The unidentified patrol officer in Arlington was sent to check on a woman who was passed out at about 5 p.m. Thursday when he spotted what appeared to be a woman lying in a grassy area, Arlington police said in a statement.

“As the officer called out to the woman repeatedly concerning her welfare, the dog began to run toward the officer while barking,” police said. “The officer retreated backwards from the running dog while drawing his duty firearm. The officer discharged his firearm multiple times toward the dog.”

The woman then “yelled out,” according to the department’s account, making it apparent that she was shot. She was later pronounced dead at a hospital and a preliminary investigation showed that she had been struck by the officer’s gunfire, police said.

The victim was identified by the Fort Worth Star-Telegram as Margarita Brooks, a 30-year-old woman known to locals as Maggie. Source told the newspaper that she was homeless and regularly hung out with her boyfriend at a shopping center not far from where she was shot.

The incident was captured on the officer’s body camera, which will be a part of an ongoing investigation, department officials said.

A police spokeswoman declined to provide additional details when reached early Friday by The Post, including how long the officer has been employed by the department and whether he has been placed on modified duty following the fatal shooting. It’s also unclear if the dog was hurt.