The neighbor of an East Oakland man who was killed by police after spraying his neighborhood with bullets two years ago has filed a civil rights lawsuit against the city of Oakland, saying officers repeatedly missed opportunities to detain a dangerous individual because of racial bias.

Attorneys for Andrea Jones say police were well aware of 32-year-old Jesse Enjaian’s armed outbursts in the days leading up to his gunbattle with police on Feb. 17, 2017, according to the federal suit filed last week. Despite shooting into the neighborhood on three occasions from Feb. 10 to 14 — including into a parked car where a homeless man was sleeping — police allowed Enjaian to remain free.

Both the homeless man and Jones, who spoke to police about Enjaian on numerous occasions, are black. Enjaian was white.

The suit “basically alleges that, implicitly, the OPD failed to properly investigate and detain and deal with Mr. Enjaian because of his race,” said Charles Kelly II, the plaintiff’s attorney. “We believe there was a situation in which this African American complainant was met with deaf ears.”

Oakland police referred all questions to the city attorney’s office, whose spokesman responded in an email that “typically we can’t comment on lawsuits until we are served and have time to review.”

Jones, who lived with her son on the 9500 block of Las Vegas Avenue, described one encounter with Enjaian on Feb. 11, 2017, after he shot out the windows of a parked vehicle near her home the previous evening. Jones said Enjaian twice witnessed her speaking to police and that police failed to take him into custody after he refused to speak to them.

“The officers did not question or arrest Jesse Enjaian,” the suit states. “They simply left.”

Jones describes a second encounter on Feb. 13, when she heard “cracking noises” outside her residence. When she opened her front door, Jones witnessed Enjaian standing outside “wearing safety glasses and ear muffs and firing a long wooden-handled rifle aimed at oncoming traffic.”

The next day, Jones said, she again heard cracking noises outsider her home. Enjaian was reportedly firing a gun at a parked car where a homeless man, Patrick Reddic, was sleeping. As Reddic fled, the suit states, he mistakenly approached Enjaian and begged for help.

Enjaian yelled at Reddic to “get the f— away from my door” and used a racial slur, according to the lawsuit. After police arrived, Reddic was the only one detained.

Jones said she met with Officer Harold Castro on Feb. 15 at Oakland police headquarters to speak about all three incidents. She said she feared for her life because Enjaian knew she had spoken to police, but Castro assured Jones that an arrest was imminent, the suit states.

Finally on Feb. 17, Enjaian opened fire on Jones’ home while she and her son were inside. The two hid under the bed as bullets crashed through the windows for 40 minutes, the suit states, before police ultimately killed the gunman.

At a community meeting at Jones’ home a few days later, Oakland Police Chief Anne Kirkpatrick said the city and police “dropped the ball” and that “mistakes were made” leading up to the final shooting.

The suit names the Police Department and Castro as defendants along with the city, and it alleges violations of the 14th Amendment.

Jones and her son, her attorneys said, “were unlawfully discriminated against because of their race.”

Two questions with Lori Frugoli, Marin County’s new district attorney

(1) What changes do you plan to make to the D.A.’s office?

There’s lots of fear in our immigrant community. We need to be out there, and we need to have our investigators and advocates out there, going to cultural and immigrant rights events. I want a position of leadership in our office. There are so many people with even 20- to 30-year-old cases that are coming back to put people in jeopardy. And the immigration laws are so complicated, depending on what your status is, that different rulings can jeopardize somebody’s status. We need to make sure we’re doing the right thing and we’re going to be speaking with the public defender’s office on these cases, documenting how many times we take into account a person’s immigration status and the consequences.

(2) What crimes are most often prosecuted by the D.A.’s office?

It comes and goes, but right now the No. 1 is DUIs. I wish I knew why, but I think it’s people not thinking they’re impaired when they are. We have a lot of repeat offenders, but I don’t think people realize the danger of alcohol abuse. It’s legal, right, just like marijuana. It’s easy, accessible and liquor’s cheap. And I think people don’t think of the consequences. It always strikes me odd that alcohol is a depressant because it loses your inhibitions, and mostly, you see people acting silly. You might not realize at the end of the day that it’s a depressant they’re using and abusing. We’ve had some nasty accidents. I don’t know that we’re educating kids in our schools. It’s an important thing we need to pay attention to.

Biggest crime news of the past week

• An hour-plus standoff with police ended with a San Jose officer shooting and killing an armed man who took a UPS driver hostage and led a chase across the city.

• The family of a young Vallejo rapper who was shot and killed by police last week are questioning the department’s tactics after he was killed while waking up with a gun in his lap.

• A woman wrongfully accused by Vallejo police of faking her own kidnapping testified about the harrowing ordeal at her alleged kidnapper’s trial.

• The San Francisco Sheriff’s Department is conducting a sprawling internal investigation amid allegations of inmate abuse and inappropriate strip searches.

• A homeless man who died of an apparent drug overdose while in Concord police custody was identified as 50-year-old Steven Hankins.

Megan Cassidy and Gwendolyn Wu are San Francisco Chronicle staff writers. Email: megan.cassidy@sfchronicle.com, gwendolyn.wu@sfchronicle.com Twitter: @meganrcassidy, @gwendolynawu