Manuela Sykes, 89, can return to flat on one-month trial basis after court of protection heard she was miserable in care home

An 89-year-old former Labour politician who suffers from dementia and wants to be looked after in the flat where she has lived for 60 years because she is "miserable" in a care home has won a court fight.

A court of protection judge has ruled that Manuela Sykes – who was a member of Westminster city council in London, stood for parliament, edited a trade union newspaper for 40 years and campaigned for better treatment for dementia sufferers – can return home on a one-month trial basis.

District Judge Anselm Eldergill also ruled that Sykes could be named in media reports – in line with her wishes and after journalists argued that identification would be in the public interest. Lawyers representing the pensioner said the judge's decision to allow identification was rare.

Details of Eldergill's decision have emerged in a written ruling following a court of protection hearing in London. Court of protection judges analyse cases involving vulnerable and sick people. Hearings are often held in private and people involved are not normally identified because of their vulnerability.

Eldergill concluded that a one-month trial of home-based care would be in Sykes's best interests, even though social workers from her local authority, Westminster city council, had raised concerns about her welfare if she left a care home.

The judge said if a trial was not attempted she would never again have the chance to live in her own home. And he said all viable alternatives should be explored before a conclusion could be reached that it was in Sykes's best interests to spend the rest of her life in a care home.

Eldergill said his decision to lift the "usual veil of anonymity" had been "finely balanced". But he said the case was relatively unusual and Sykes's personality was a critical factor. He said she had always wished to be heard, would want her life to end with a "bang not a whimper" and had a "last chance to exert a political influence".

He also said archival photographs of Sykes could be published, although not a current picture.

Anne-Marie Irwin – a specialist court of protection solicitor from the law firm Irwin Mitchell, who had represented the pensioner's interests during litigation – said Sykes had been a leading dementia campaigner who now had the illness and was miserable in a care home.

"Manuela is firmly of the view that with the right kind of care package, she could be supported to return home safely," she said. "Although the kindness of her carers was praised, Manuela was miserable at the care home, and we asked the court to consider if it is truly in her best interests to remain deprived of her liberty. The court was asked on her behalf – what is the point of being kept safe, when to do so is also making you miserable?"

She added: "We are confident that with specialist dementia carers Ms Sykes can greatly benefit from returning to her own home."