ALAMEDA -- The police and firefighters who remained on shore as Raymond Zack waded into San Francisco Bay on Memorial Day 2011 and succumbed to hypothermia were under no legal duty to help him, a judge ruled Monday.

Officers and firefighters also did not worsen the 52-year-old Zack's condition by clearing Robert Crown Memorial State Beach or by preventing people from going to his aid, Judge George Hernandez said in a ruling that effectively tosses out a lawsuit that Zack's family filed against the city of Alameda.

Robert Cartwright, the family's attorney, said he will ask the judge to reconsider. He said he will also appeal if the judge refuses. Along with first responders, dozens of people were on the beach when the fully-clothed Zack waded into the water and stood at least 100 yards from shore.

Police said they stayed on the beach because Zack was suicidal and possibly violent, while firefighters said they were not certified in land-water rescue and did not have a boat that could maneuver in the shallow water. Officers and firefighters did attempt to secure a rescue boat from the U.S. Coast Guard, however. Zack's family maintain onlookers should have been allowed to help.

"It was a very tragic situation," said Gregory Fox, the city's attorney. "But the court found that the officers acted reasonably and within the law."

Emergency crews were dispatched after Dolores Berry, who described herself as Zack's foster mother, asked a passer-by to call 911, saying Zack did not know how to swim and was possibly suicidal, the court heard. Zack reportedly suffered from mental illness. An onlooker eventually pulled Zack back onto shore after he began floating facedown. He was pronounced dead a short time later at Alameda Hospital.

"The court finds that under the circumstances presented, there was no moral blame attendant to the conduct of the responding officers and firefighters," Hernandez said in his ruling at the Hayward Hall of Justice.

The judge also said officers and firefighters had no duty to allow people to stay in the area, "or enter the water where they might be exposed to harm or injury or require rescue themselves."

The ruling Monday came after Fox filed a "demurrer," or a challenge to the legal sufficiency of the Zack family's claim. Bernice Jolliff, Zack's sister, and Robert Zack, his brother, were seeking unspecified damages against the city and county of Alameda. Zack's death sparked nationwide criticism of Alameda police and firefighters and prompted an independent investigation by former state Fire Marshal Ruben Grijalva on how the departments respond to water-based emergencies.

Reach Peter Hegarty at 510-748-1654 or follow him on Twitter.com/Peter_Hegarty.