SAN ANDREAS, Calif. (AP) — A hostage and a California sheriff’s deputy were wounded and a suspect was killed in shootings stemming from a domestic violence incident, authorities said Friday.

The violence erupted late Thursday in the Sierra Nevada foothills community of San Andreas, about 50 miles (80 kilometers) southeast of Sacramento.

The Calaveras County Sheriff’s Office said in a statement that a 911 caller reported a male and female in an argument at a motel shortly after 10:30 p.m. and that the male had pointed a firearm at the female’s head.

The suspect was gone when deputies arrived and a search began. A deputy interviewing the victim was ambushed and shot in the upper body but managed to get the victim to safety, the statement said.

Deputies and other law enforcement officers were searching an apartment complex when the suspect appeared while holding an elderly woman at gunpoint. Efforts to get the suspect to surrender failed and at some point the suspect “posed an immediate threat to the victim,” the statement said.

“Shots were fired and the suspect was struck. The hostage was also struck by gunfire,” it said. The statement did not say whether the suspect fired.

The hostage and wounded deputy were expected to survive.