The Long Beach City Council on Tuesday approved paying $845,000 to settle a lawsuit alleging police used excessive force when they shot and killed a driver at the end of a pursuit in 2017.

After a 40-minute chase where the driver tossed a gun out the window of a stolen car, four Long Beach police officers shot 20-year-old Juan Manuel Avila Jr. eight times after he was cornered outside of a Bellflower storage facility, according to court documents.

Authorities said officers fired 28 rounds at Avila when he turned the car around and started driving at them, but Avila’s parents filed a federal lawsuit, claiming Avila was trying to drive around officers, not at them. Avila had begun to stop the car, realizing there wasn’t room for him to pass, before police opened fire, the lawsuit alleged.

The lawsuit also took aim at LBPD policy, claiming the department allows its officers to shoot at drivers in pursuits to stop them, something that’s, “universally accepted as ineffective and unwise,” it claims.

Long Beach’s attorneys pushed back on this in court documents, saying LBPD policy prohibits shooting at moving vehicles unless it’s as a last resort.

“The LBPD policy and training with respect to deadly force is that it is justified if there is an immediate threat to life, or if there is a substantial risk that if apprehension is delayed, the suspect will cause death or great bodily injury to others,” the city’s attorneys wrote.

In this case, they said, officers had already seen several near-crashes while Avila was trying to get away. Police also feared there could be another gun in the car, court documents say.

Because of the litigation, a police spokeswoman declined to say whether LBPD officials believed this specific shooting fell within the bounds of the department’s policy.

Earlier this year, the Los Angeles County District Attorney’s office decided the four officers who shot—Ivan Garcia, Benjamin Hearst, Nicholas Becerra and Elieser Domingo—acted legally.

“Avila’s erratic and perilous driving posed a substantial risk of death or serious injury to the public,” the report says.

The report describes security camera footage and video from a news helicopter that show the shooting, which happened at the dead end of Foster Road in Bellflower at around 6:30 a.m. on April 25, 2017.

The videos show Avila’s car headed toward officer Garcia before coming to rest at a curb, but because there’s not audio, investigators couldn’t tell exactly when the shots were fired, according to the DA’s office.

The report also notes Avila had methamphetamine in his system. A passenger in the car wasn’t hit by the gunfire, according to authorities.

That DA’s decision, to clear the officers pertains only to criminal culpability, not any possible civil liability a jury could have imposed if they decided officers acted inappropriately.

The lawsuit also accused the department of negligence in training its officers.

Jason Ruiz contributed to this report.