SAN BERNARDINO, Calif. — A suspect in a shooting that killed a 3-year-old girl and left a pregnant woman and her toddler critically wounded was motivated by revenge against a Good Samaritan, police said.

The surviving toddler, also a 3-year-old girl, is in critical condition, reported The Los Angeles Times, as is her mother, who is five months pregnant.

The suspect is accused of assaulting a woman, who lived near the shooting victims, in San Bernadino on Monday, San Bernardino Police Chief Keith Kilmer told The L.A. Times.

Witness accounts led police to believe that the Good Samaritan saw the gunman assaulting the woman Monday and intervened, allowing her to escape, said San Bernardino police Lt. Gwendolyn Waters.

The suspect apparently then went to the man's home Monday evening and started shooting, she said. The shots hit the pregnant woman in the neck and jaw, and both 3-year-old girls in the head. One, Nylah Franco-Torrez, was pronounced dead at the hospital, according to The Times.

"We believe it was revenge," Waters said Tuesday. "This is somebody that was trying to do a good deed."

Neighbors said an extended family lived inside the house. About a dozen people were home when the shooting occurred, Waters said, but the relationships among them were not entirely clear.

Police on Wednesday were searching for the gunman, who they believe ran away, and want to speak to the woman who was assaulted and at least two other witnesses to the assault.

The pregnant woman and her 3-year-old daughter remained hospitalized Tuesday, authorities said. The woman was upgraded to stable condition, but the 3-year-old was in extremely critical condition late Tuesday, Waters said.

The pregnant woman and her 3-year-old daughter were on the porch of the house when they gunfire started, Waters said.

Police are not releasing the names of her or her daughter. The fetus appears unharmed, Waters said.

Sophia Cardona, the great-grandmother of Nylah Franco-Torrez, told The Times that she was cooking when shots started.

"We lost one of our babies," Cardona said of Nylah. "She was a sweet little girl."

On Tuesday, residents — some who didn't know the victims — left teddy bears, candles and flowers at a memorial set up outside the family's bullet-riddled home.

"We're just outraged. We're disgusted about the whole situation," said LaTonya King, who visited the family and planned to voice her concerns at a City Council meeting next week. "We don't want to see this thing slid under the rug."

Residents of the mustard-colored house wedged between a tax service business and a boarded-up home declined to comment when approached by The Associated Press.

Frank Damian had just gone inside his house across the street to watch television when he heard the shots ring out.

"It went pow-pow, pow-pow-pow — it was about a good 20 shots," said Damian, adding that his wife grabbed the phone and called 911.

At a news conference Tuesday, police released a photo of Franco-Torrez wearing a blue-flowered sundress, her eyes looking straight at the camera.

Kilmer urged the public to come forward with any information that could help officers in their investigation and encouraged the gunman to turn himself in.

"We will find you, we will seek you out and we will arrest you and bring you to justice," Kilmer said. "We are going to be relentless."