Police officers shot and killed a man Sunday night when he emerged from his home carrying a young girl following an hours-long standoff and opened fire, wounding one officer, authorities said. The girl was also killed in the gunfire.

The man killed was identified as Jose Raul Lemos, and the girl, about 17 months old, was related to him, police said. The officer, who was not immediately identified, was shot in the shoulder and was expected to survive.

There were three exchanges of gunfire between police and Lemos, who was either age 34 or 35, Assistant Police Chief Jim McDonnell told reporters. In the final exchange, at around 6:20 p.m., Lemos held the girl as he shot.

"We did everything we could to hold our fire," McDonnell said. "We showed a tremendous amount of restraint, but unfortunately the suspect's actions dictated this. ... It's a true tragedy."

The standoff began at around 3:50 p.m. when officers responded to an area in South Los Angeles (search) west of Watts after residents reported a man behaving erratically and aggressively. Lemos fired at the officers and ran inside a fenced area that included his apartment and his car wash and detailing business. He had a 9 mm handgun and a shotgun and was intoxicated on drugs and alcohol, police said.

Police called in a SWAT team and tried to speak with the man; when they at one point attempted to help a neighbor escape the area, he fired at them and they fired back, McDonnell said.

Officers were struggling with the thought that they killed an infant, he said.

"The officers are taking it very hard," McDonnell said. "Anytime you have a baby killed, it takes its toll."