It is one of the least understood institutions in Scotland. The State Hospital at Carstairs holds some of the country's most disturbed and violent offenders. Invariably, its very name conjures up horror stories, but in practice the stigma does not fit the reality of everyday life in its grounds.

Contrary to popular misconceptions, one-third of the patients here have committed no crime.

Inside the high-perimeter fence the grounds are green and well-kept. Separate grey buildings make up what looks like a community compound. Some of the patients sit on a bench, soaking up the winter sunshine between the leisure centre and dining hall.

Built in 1936 to house people then referred to as "mental defectives", the hospital has undergone a number of different incarnations and is now being rebuilt to provide a more suitable setting for patients with complex mental health problems.

By 2011 there will be a new purpose-built hospital in the same grounds to house 140 male patients rather than the current 240 men and women. Some 100 patients - some of whom may be killers or rapists - and all of the female patients are gradually being moved to lower-security units.

The fearsome reputation of the hospital means many will oppose the move, but those involved say it should ensure the care and security for each patient, and ultimately the public, is more suitable.

When Andreana Adamson was appointed chief executive of the State Hospital in 2002, she was shocked by conditions in the wards and by the stigma that the patients were mad axe-men locked up for life. She is working hard to change that misconception.

Before taking the post at Carstairs she was director of planning at Lothian Primary Care Trust. As well as improving hospital facilities for patients, her involvement culminated in the sale of the former Gogarburn Hospital to the Royal Bank of Scotland.

"Media coverage often tends to be historic and controversial, focusing on a few high-profile patients," she said. "It is sensationalist and stigmatising using offensive, inaccurate words such as monster', lunatic' and caged killers'. No wonder public perception is one of fear and concern."

As with the make-up of those housed there decades ago, some have committed crimes, others have not, but the reputation of what is now the State Hospital has suffered under the weight of assumptions made about some of the cases sent there.

One young man killed his father, another killed a policeman, others were sent to court for rape or, in the case of some women, for killing their own children.

Some 70% of the patients currently in Carstairs suffer from schizophrenia. One in four has committed homicide.

Almost one-third were referred from other NHS hospitals, 38% came from prison and 33% from the courts. Many patients were victims of crime in their childhood and have a history of antisocial behaviour and substance abuse. On average, people stay in the high-security compound for seven years. Some have been here more than four decades.

Patients, depending on their risk level, are given access to the grounds, including the opportunity to tend the hospital's own garden and animals as diverse as pygmy goats and New Zealand pigs.

There is a sports centre inside the grounds and educational opportunities for those who wish to improve their literacy. The State Hospital has a staff of 700 - more than two for each patient - including a broad range of psychiatrists and doctors. Currently, only the most violent patients are locked up.

In the past, 50 to 60 patients were placed on waiting lists each year to be moved out of the hospital, but there was nowhere for them to go. They may have been forced to wait for years for a place in a lower-security setting because of shortages.

The national forensic network, led by Ms Adamson, has worked with health boards and local services to increase the places in lower-security settings.

"The therapeutic aim of inpatient forensic services is to address violent, aggressive and offending behaviour," said Ms Adamson. "It is vital that patients are treated in accommodation appropriate to their needs in an environment that supports their rehabilitation."

There are currently no female patients requiring the high security the State Hospital offers, and in future female patients will be treated and cared for by appropriate regional and local facilities offering lower levels of secure care.

Ms Adamson added: "We have been phasing the transfer of female patients from the State Hospital for some time now."

Under the Mental Health (Care and Treatment) (Scotland) Act 2003, patients can appeal to the Mental Health Tribunal against excessive levels of security and compulsory measures.

Some 24 appeals have been upheld and patients are being transferred to lower-security units such as the Rowanbank clinic in Glasgow and Orchard clinic Edinburgh. Under the European Convention on Human Rights (ECHR), patients not moved to a suitable unit could sue.

In 2003, Malcolm Chisholm, the then health minister, said: "A key measure of success will be a smaller State Hospital services can and should be provided in other secure and community settings."

Some victims' groups will still be concerned at the news people who have committed such violent offences are being brought a step closer to the community, but every transition is phased and every attempt made to ensure patients are placed in the most suitable surroundings.

Inevitably, there will be those who abscond from lower-security settings. Some already have, but Ms Adamson insists the ethos has to be one of care and treatment.

"Treatment for people is the most important thing in ensuring that person and those in the community are safe," says Donald Lyons, director of the Mental Welfare Commission, which works to safeguard patients' rights.

"Security may be necessary when a particular person is at their most unwell, but once they are being treated that risk goes down and once they are recovering that person has to be allowed to get on with their life back in the community.

"One in four people will suffer a mental disorder at some point in their lives. A very small proportion of these people will require particularly specialist care such as that in the State Hospital. Under the new legislation the system is working much better."