A judge has ruled that city coroners do not have to return a dead person's organs to his or her family after an autopsy.

The ruling stems from the 2005 death of 17-year-old Jesse Shipley, whose brain was kept by the Medical Examiner and discovered in a jar two months later by his classmates on a school trip to the mortuary. Shipley had already been buried for weeks.

Shipley's family is distraught by the ruling, their attorney, Marvin Ben-Aron, told the Daily News. “They feel like after suffering an injury at the hands of the city 10 years ago, they’ve now suffered injury at the hands of court,” he said.

In 2011, a jury awarded the Shipleys $1 million in recompense for the mess-up in 2011. Wednesday's ruling overturned that award. “There is simply no legal directive that requires a medical examiner to return organs or tissue samples derived from a lawful autopsy,” Judge Eugene Pigott wrote.

Jesse and his sister, Shannon, then 14, were riding in a Mercedes-Benz that collided with an SUV on Staten Island in January 2005. The impact crushed the back seat where Jesse was sitting; Shannon, the front-seat passenger, suffered minor physical injuries.