Witness accounts led police to believe that a man living at the home saw the gunman assaulting another woman Monday and intervened, allowing the unidentified woman to escape, said San Bernardino police Lt. Gwendolyn Waters.
The suspect apparently went to the man's home Monday evening and started shooting, she said.
"We believe it was revenge," Waters said Tuesday. "This is somebody that was trying to do a good deed."
Police on Wednesday searched 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 gunfire struck 3-year-old Nylah Franco-Torrez in the head, and the girl was pronounced dead at a hospital.
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 woman was shot in the neck and jaw, and her daughter was shot in the head while on the porch of the house, Waters said. Police are not releasing the name of the woman, who is five months pregnant, or her daughter. The fetus appears unharmed, Waters said.
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.
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.
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 little Nylah wearing a blue-flowered sundress, her eyes looking straight at the camera.
Police Chief Keith 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."