A judge in Maryland has overturned a nearly $38 million award for the family of Korryn Gaines, a 23-year-old woman shot and killed by Baltimore County police almost three years ago.

Judge Mickey J. Norman presided over the civil case in Baltimore County Circuit Court last year that issued one of the largest ever awards against police in that county, according to the Baltimore Sun. But after reviewing post trial motions by Baltimore County lawyers, Norman ruled that Cpl. Royce Ruby was entitled to immunity from civil liability afforded law enforcement when carrying out official duties. It was Ruby who fired the shot that killed Gaines and sent a bullet fragment into the cheek of her 5-year-old son, Kodi, on Aug. 1, 2016.

READ MORE: Reversal of damages in Korryn Gaines case being sought, despite jury finding of liability

A lawyer for Gaines’ family told the Sun they plan to appeal.

“It’s not over,” J. Wyndal Gordon told the news organization. “It’s devastating to a certain extent, but they’re a very faithful family.”

The trouble unfolded after police went to Gaines’ home in Randallstown, Md., to serve a warrant on her and her fiance for an alleged failure to appear in court for charges related to a traffic stop.

The judge wrote in an opinion issued last week that in a standoff that lasted hours, Gaines began to raise a shotgun as she “abruptly moved from a place plainly visible in the living room to partial concealment behind a kitchen wall.”

The judge wrote, “Corporal Ruby believed she was about to fire the shotgun.”

READ MORE: Baltimore jury awards $37M in fatal police shooting of Korryn Gaines

But the family’s lawyer said police knew Gaines suffered from mental illness, according to the Sun.

One month after the shooting, prosecutors said the shooting was legally justified, prompting the family to bring a civil action against Baltimore County and police.

Gordon said the hope is that on appeal, legal issues that a jury did not get to consider will be aired.

“The bottom line is we get a chance to have a full hearing before an appellate court,” he told the Sun.