PATIENTS' casebooks from the former Roundway Hospital, going back nearly 150 years, have been saved for posterity by a £10,000 grant.

Archivists at the Wiltshire and Swindon Record Office were deeply concerned at the state of the 40 casebooks, which were literally falling apart, and feared the irreplaceable records, giving a fascinating insight into how mental health care has changed in the last century and a half, could be lost forever.

But thanks to a grant of £10,000 from the British Library and Wellcome Fund, the documents can now be restored, allowing historians to unlock their secrets.

During the 19th century, people with learning difficulties, epileptics, women with illegitimate children and pensioners suffering with dementia were often incarcerated in asylums alongside patients with depression, schizophrenia and a range of other conditions.

Wiltshire's county asylum, which opened in 1852, was later renamed Roundway Hospital and continued to operate as a psychiatric unit right up until its closure in 1995. Part of the site has now been transformed into Drews Park village and last week Kennet District Council received planning applications for the redevelopment of the northern part for another 200 homes.

John d'Arcy, principal archivist at Wiltshire and Swindon Record Office, said: "We are delighted to have been awarded this grant, which covers all the costs of conservation and will ensure these fascinating documents remain intact for the benefit of present and future generations.

"The casebooks are very special as they give a detailed and intimate description of the patients' lives and medical histories. Researchers and historians will be able to gain valuable insights into how the Victorians saw mental illness.

"Many of the patients treated at Roundway during the Victorian era would not be viewed as mentally ill today and no doubt the way society views mental illness will continue to change over the next 100 years."

Some of the case studies in the archives reveal stark stories of how mental patients were treated.

John Farr, a young man of 22, survived for less than a month after being admitted to Roundway from a workhouse in Swindon on October 17 1881, although what caused his death was not recorded.

Doctors described his condition as 'congenital idiocy,' referring to his occupation as 'idiot.' Medical staff described his behaviour with a mixture of fear and disgust. In their notes, they say: "He, a day or two since, threw a knife at the wards man. The patients in the ward are very much afraid of him. He tears all his clothes and is generally half naked. Disgusting in his behaviour in every way."

Cloth mill worker Luke Farley, 53, from Chippenham, was admitted on November 25 1881 after threatening to kill himself and his wife. Doctors diagnosed him as suffering from 'mania'.

Their notes say: "He is restless and talkative. Converses in a rambling and childish manner without proper reflection. His demeanour is flighty and nervous and he passes sleepless nights.

"He is possessed of the delusion that he is instigated by unseen persons to acts of violence."

He died a year later, on December 25, 1882 from epileptic convulsions.

David Wilson Homes, the developer who hopes to build 200 homes on the derelict northern site at Roundway Hospital, submitted seven planning applications to Kennet District Council last week.

They cover the building of an internal spine road to serve the new estate and plans to convert existing buildings, such as the boilerhouse, the farmhouse, the annexe and the Wyvern building, to homes, with the demolition of some parts of the buildings.