Officers with the Los Angeles Police Department responded to reports of gunfire around 7:15 p.m. Sunday. When they arrived, they entered the unit where the family lived and discovered the bodies of the two boys and their father, police said.
Police said the shooting was being investigated as a murder-suicide and the boys' father is believed to be responsible.
Neighbors said the incident may have occurred during what they described as a family gathering, with some indicating it could have been a birthday party.
Giovani Trejo, who lives nearby, said he was at home at the time.
"I was watching television," he said.
Trejo said he did not hear the gunshots but realized something was wrong when police arrived shortly afterward. He said officers knocked on his door and asked him and others in the area about what had happened.
The incident left residents shaken. Neighbor Avy Perez said she came to the scene to offer support.
"Even though we may not see their family, we thought that they needed some prayer and some thought because ... I don't know. I know me personally, whether I know them or not, I would want to pray for someone, for healing and overall as a person, because that's sad and I don't wish that upon anybody," she said.
Family members returned to the apartment complex Monday morning but declined to speak the media.
Later that morning, personnel from the medical examiner's office removed the bodies from the unit.
Police have not released the identities of the victims as the investigation continues.
If you are struggling with thoughts of suicide or are worried about a friend or loved one, help is available. Call or text the National Suicide Prevention Lifeline at 988 for free, confidential emotional support 24 hours a day, 7 days a week.