A judge has raised concerns about a woman with mental health difficulties who he says has "effectively been detained" in hospital for the best part of six months because her home is not fit to live in.

Mr Justice Hayden said he wants council social services bosses at Greenwich with responsibility for the woman's welfare to ensure that work is carried out at her home as quickly as possible so she can leave hospital.

Council bosses say plans are now in place to carry out work at her home.

He said the woman, who is in her 60s, had unnecessarily been in hospital since October and suggested that she was being harmed by a "State" which was meant to care for her.

The woman is at the centre of litigation in the Court of Protection, where judges consider issues relating to people who lack the mental capacity to make decisions for themselves.

He raised concerns at the most recent hearing in London at the Family Division of the High Court, and said the woman could not be identified in media reports of the case.

But he said Greenwich Council had responsibility for her welfare and could be named.

Lawyers told him the woman, who has a personality disorder, had last year gone into hospital after experiencing physical health problems.

They said she was "difficult" and that her home was not habitable.

Mr Justice Hayden told the hearing: "I don't have a problem with difficult old people, I hope that I will be one myself.

"What I do have a problem with is a woman who is in a hospital ward, where she has been since October, who has not been required to be there for health reasons since October, and through November, December, January and February has effectively been detained there against her will, in circumstances that are wholly inappropriate, by a State that purports to be caring for and assisting her."

He said the woman had pets which she had been separated from, and added: "If the State had been intending to harm her and hurt her they could not have done so more effectively."

The judge also said she was occupying an NHS bed which could be used by someone who needed it.

He said he wanted council staff to make arrangements for improvement works to be carried out as quickly as possible.

Lawyers left court to relay his message to council bosses then returned to say that work aimed at making her home habitable would start soon.

The judge said he would reconsider the case in the near future.

Cllr Averil Lekau, cabinet member for adult social care and health, said: “Every effort is made by the council to organise suitable care arrangements, and in this case we have acted swiftly to facilitate a safe transfer home for the resident following the court’s orders.

"The best interests, safety and support of our residents remains the council’s primary focus, and exhaustive efforts are made to accommodate complex care requirements.

"In this case, due to discussions with the resident, the ongoing legal proceedings and the challenges faced in identifying appropriate support to the resident given their complex needs, we regret that they remained in hospital despite being medically fit for discharge whilst their care package was being agreed.

"The council continues to have concerns about the resident’s return to their personal home due to the ongoing accessibility difficulties and the lack of engagement with our support services. Nevertheless, the council has acted in a manner to promote their best interests and arrange their return home with support and a plan to mitigate the risk to the resident in accordance with the court orders.”