John Straffen, who has died in Frankland prison, County Durham, aged 77, will always be remembered as one of the country's most notorious child murderers - though he was also the victim of one of the most shaming trial processes in the history of English criminal justice. At the time of his death, he was Britain's longest-serving prisoner, having been incarcerated for more than 55 years.

He was born in Borden, Hampshire, but spent his early years in India, as his father was in the armed forces. From 1938, when the family returned to England to live in Bath, Straffen was in virtually constant trouble with the authorities - albeit, at first, for trivial thefts - and was sent to special schools.

After wringing the necks of five chickens in 1947, he was certified as feeble-minded and committed to what was then termed a colony for mental defectives at Almondsbury, north of Bristol. Released on licence in 1951, he was examined at a Bristol hospital, where electro-encephalograph readings showed that he had suffered "wide and severe damage to the cerebral cortex, probably from an attack of encephalitis in India before the age of six".

On July 15 that year, he encountered six-year-old Brenda Goddard, who was picking flowers in a field. He encouraged her to walk with him and then strangled her in a wood. A few days later, he met nine-year-old Cicely Batstone at the cinema. He befriended her, took her to see another film and then strangled her.

After he was arrested, Straffen immediately confessed and was committed for trial at Taunton. However, the judge told the jury: "In this country we do not try people who are insane. You might as well try a baby in arms." Straffen was found unfit to plead and sent to Broadmoor.

At about 2.40pm on April 29 1952, he jumped over the wall and, though the alarm was quickly raised, enjoyed four hours of freedom. He was pursued by two staff members on bicycles and recaptured about seven miles away, in Arborfield, at 6.40pm. That evening, at about 10.30, five-year-old Linda Bowyer was reported missing in Arborfield. Her body was found the following morning. She, too, had been strangled and, naturally, almost the entire country jumped to one conclusion.

When Straffen stood trial for Bowyer's murder at Winchester assizes, the first task of the prosecution was to argue that, notwithstanding the finding of the previous court, he was fit to plead. Astonishingly, the judge agreed. He not only allowed the trial to proceed but allowed the press to report legal arguments heard in the absence of the jury. The trial, however, was soon abandoned after one of the jurors was overheard saying that he believed Straffen to be innocent and that one of the prosecution witnesses was responsible for the girl's murder.

By now, Straffen had had two aborted trials. As the third trial began, most newspapers carried posed photographs of the three mothers of the murdered girls having tea together. With even the pretence of a fair trial having been abandoned, on July 25 Straffen was found guilty and sentenced to be hanged on September 4.

There had been a public outcry after his escape and Linda Bowyer's murder. Now there was an outcry of a different kind. "It is not the sanity of John Straffen that is in question," wrote one doctor, "but the sanity of the law." On August 29, Straffen was reprieved by the home secretary on the grounds of insanity. In less than 12 months, during which time Straffen had received no medical treatment, the authorities had contrived to find him insane, sane and insane.

While acknowledging his resp-onsibility for the deaths of Brenda Goddard and Cicely Batstone, Straffen always asserted that he had not killed Linda Bowyer. His case was persuasive: there were right-hand fingernail markings round the girl's throat, but Straffen's right-hand nails were bitten down to the quick; the murderer must have taken the girl's bicycle and dumped it in a hedgerow, but Straffen's fingerprints were not on it; virtually every minute of Straffen's time at large was accounted for by witnesses; and a girl's screams were heard at about 7.00pm - after he had been recaptured.

When the Criminal Cases Review Commission began its work in 1997, Straffen submitted his own case to them. However, even though it was later taken up by well-respected lawyers, it was never reopened, although he had recently been downgraded to category B and was due for transfer to a secure mental unit outside the prison system.

· John Straffen, murderer, born February 27 1930; died November 19 2007