ROCKLAND — The state is immune from liability for selling the waterfront house of a man in its care for well below its value, allowing another home he owned in Rockland to fall into disrepair, selling off his personal belongings and euthanizing his cat.

The Maine Supreme Judicial Court ruled Thursday in the lawsuit brought on behalf of William Dean against the Maine Department of Health and Human Services.

The ruling comes nearly four years after the original lawsuit was filed and nearly six months after the high court justices heard arguments on the matter. Dean has died since that hearing, succumbing to natural causes on Oct. 16. He was 71.

Cynthia Ann Dill, Dean’s Portland-based attorney, said Thursday that she respects the ruling but urged the Maine Legislature to expressly provide by statute that when the DHHS acts as a public guardian it is “accountable for damages caused when, as in this case, the duty of care is so grossly breached.”

Dean suffered from mental health issues throughout his life. Among other things, he had Asperger’s syndrome, an autism spectrum disorder that made it difficult for him to interact with other people.

He also was a musical savant. He never had a music lesson but was able to play a song if he had heard it once. His musical instrument of choice was the organ.

After his mother died, Dean had a mental health crisis and was admitted to the Dorothea Dix Psychiatric Center in Bangor in May 2012.

The Maine Department of Health and Human Services filed a motion on Sept. 5, 2012, in probate court seeking to be named his conservator and guardian. The state said that he was not competent to manage his properties, and that bills had not been paid, including property taxes.

Dean’s cousin Pamela Vose had offered to be conservator, but had a family medical emergency and asked that the state not appoint anyone else while she dealt with that situation.

However, the state filed for conservatorship without letting Vose know, contending there was “no suitable private party available and willing to assume such responsibilities.” A probate judge in Penobscot County approved the temporary appointment of the DHHS as conservator and guardian on Sept. 6, 2012.

Before the end of that year, the state put Dean’s Owls Head cottage and the Rockland family home up for sale, citing tax liens and other bills that had to be paid. He had inherited the properties when his parents died. In January 2013, the waterfront cottage in Owls Head was sold for $205,000, even though the town had the property – 1 acre with 100 feet of ocean frontage and the 1,000-square-foot, two-story cottage – assessed for tax purposes at $476,840.

The Maine Attorney General’s Office, which represents the DHHS in lawsuits, argued that the Owls Head property was not worth the taxable value because of problems with septic and water systems and because it was next to a property that was in deplorable condition.

According to court records, the state moved up the sale date of the Owls Head property by one day after the family found out about the sale and informed the DHHS it would seek a court injunction to stop the sale.

The state also tried to sell the Rockland home on Broadway, but a pipe burst during the winter when there was no heat and caused major flooding, which then led to mold throughout the home, making it uninhabitable.

Money from the sale of Dean’s assets paid for his care and went to his estate, the value of which dropped dramatically, according to court papers filed by David Jenny, Dean’s attorney. He said Dean had $654,000 worth of real estate that was free of mortgages in September 2012, but he was down to $20,000 in assets when he was released from Dorothea Dix in 2013 after less than a year under DHHS conservatorship.

Following his release, Dean rented one apartment and then another in Rockland.

In an October 2015 interview, Dean said the state’s decision to euthanize his longtime companion, a 10-year-old Himalayan cat named Caterpillar, bothered him the most.

Dean said he also was upset that the state sold his 2000 Cadillac Eldorado. The car was sold for $385, even though the book value was roughly $5,600.

Dean was aware the state was trying to sell the Owls Head property while he was in the hospital, but did not learn about the sale and the low price until after he was discharged. “I was not very happy about it,” he said.

Among the possessions that the state tried to sell but were retained when the family took legal action were Dean’s three organs. When asked in 2015 what he would like to come out of the legal proceedings, Dean had a one-word answer.

“Justice,” he said.

Claire Dean Perry, William Dean’s sister, originally sued DHHS on her brother’s behalf in May 2013.

“I feel absolutely devastated. I feel like a Mack truck went over me,” she said Thursday.

Dean Perry said she wanted a jury to hear the case and decide whether the state had acted improperly. She said the loss of the Owls Head home and the loss of the cat and car weighed down her brother in his final years.

“It permeated his whole being,” she said.

In December 2015, Justice Andrew Horton of the Maine Business and Consumer Court in Portland ruled that the lawsuit could go forward on the single issue of whether the state breached its fiduciary duty while it served Dean’s conservator in 2012 and 2013.

The DHHS appealed that lower court ruling. Assistant Attorney General Christopher Taub argued that the state is immune from liability under the Maine Tort Claims Act. He said there are exceptions to the immunity, but only when it is spelled out in other laws approved by the Maine Legislature.

The Supreme Court justices agreed, saying there is nothing in the state’s probate laws that waives immunity, even when the state serves as a conservator for someone in its care.