A Boston juvenile court judge has given the state of Massachusetts permanent custody of Justina Pelletier until the age of 18, issuing a ruling that chastised the parents accused of mismanaging the treatment of their sick 15-year-old.

Justina has been under the psychiatric care of Boston Children's Hospital for the last 13 months and her parents, Lou and Linda Pelletier of West Hartford, Conn., have been only allowed to see their daughter once a month under state supervision.

Suffolk County Court Judge Joseph Johnston ruled March 25 that the girl will remain in the hands of the Massachusetts Department of Children and Families unless her parents can prove they are capable of taking care of their daughter.

The four-page ruling slammed the family for verbally abusing hospital caregivers by calling them "Nazis" and accusing them of "kidnapping" and "killing" their daughter, according to a copy obtained by ABCNews.com.

The judge also alleged that the social worker assigned to Justina's case had to be reassigned because Lou Pelletier threatened her. He said the family has stood in the way of every attempt to get Justina treatment.

"Efforts by hospital clinicians to work with the parents were futile and never went anywhere," read the ruling. "Unfortunately, there has been not any progress by the parents."

Lou Pelletier, who filed an appeal in the custody case last December, told ABCNews.com that he is now ready to file a writ of habeas corpus in Massachusetts Supreme Court for "wrongful imprisonment" of his daughter.

"Eventually, we are working on federal lawsuits to do with civil rights violations," said the financial planner, who is the father of four girls. "We are just trying to determine which state to file them in.

"Obviously, as much as we are devastated, this is the corrupt, crooked court system," he added. "This shows the judge is a coward."

The judge in the case ruled that Justina has "a persistent and severe somatic symptom disorder," a psychiatric condition that causes a person to experience physical pain for which no known medical explanation can be found. He said the ruling was based on "credible medical and psychiatric evidence."

The judge said Justina was ready to be discharged from Boston Children's Hospital in June 2013, but she remained an additional seven months because placement was "significantly hampered" by her parents.

He added that the Pelletiers had stood in the way of Connecticut child protective services placing Justina close to home because they "threatened to sue." Other suitable programs denied placement because of "concerns of litigation," according to the ruling.

For the last year, Justina has been in temporary state custody under court-ordered treatment at Boston Children's Hospital in a case that has pitted those involved in her care against her family and enraged advocates.

Lou Pelletier has said that before the family took Justina to Boston Children's Hospital's emergency room in February 2013, she was being treated by Dr. Mark Korson at Tufts Medical Center for mitochondrial disease, a rare genetic disorder with physical symptoms that can affect every part of the body.

Since then, Justina has been confined to a wheelchair, and Lou Pelletier has alleged her medical symptoms are not being treated and her condition has deteriorated.

Justina's older sister, Jennifer Pelletier, 22, told ABCNews.com she was concerned about swelling in Justina's legs, which "could be a heart or kidney condition."

"Every time I see her she is worse," Jennifer Pelletier said.

Boston Children's Hospital has argued that Justina's symptoms are psychosomatic and laid out a treatment plan that the parents rejected. The hospital then filed a complaint with the Massachusetts Department of Children and Families, as required by law, because it suspected the parents of child abuse for subjecting their daughter to invasive medical treatments and denying her mental health therapy, according to numerous reports in the Boston Globe.

Boston Children's Hospital released this statement following the court ruling: "We understand that the nature of this case has prompted questions and sparked strong reactions. But our clinical team has always acted in the best interest of the patient's health and well-being, according to the high standards we follow for every patient placed in our care.

"This case was a complex matter, presenting an array of challenges and obstacles that we cannot discuss out of respect for our patient's privacy and legal confidentiality requirements. We have been unable to provide a full and accurate picture of the case. But we are confident the treatment plan developed for our patient was the best course given the issues surrounding her medical history, the evaluations and observations of her care teams prior to arriving at Boston Children's and after she was admitted here."

When asked whether Justina was receiving medical treatment for mitochondrial disease or if Korson was consulting on her treatment, spokesman Rob Graham said he could not comment because the hospital was "restricted" by HIPPA rules regarding patient privacy.

Tufts Medical Center sent this statement: "We have a group of clinicians who have agreed to be a part of Justina Pelletier's treatment plan. We will provide care as needed."

Hospital spokesman Jeremy Lechan also would not say whether or not Korson was part of that team.

The family previously told ABCNews.com that Korson was supporting them "100 percent" in the court case.

Justina is now living at Wayside Youth and Family Support Network, a residential program in Framingham, Mass.