THE number of people in Scotland being detained under mental health legislation is at its highest since the law was overhauled a decade ago.

The Mental Welfare Commission (MWC) said the number of compulsory detention orders, or sections, has been rising steadily. Last year there were 4,350 - the highest since the Mental Health Act was implemented in 2005.

An increase in the sectioning of older people is one reason for the rise, while fewer specialist mental health officers means greater strain on psychiatric hospitals and services, the watchdog said. It warned if the status quo is left unchecked, the mental healthcare system in Scotland could collapse.

Last year, there was a "marked increase" of 14 per cent in the number of over-85s - a total of 92 - served with emergency detention certificates. Guardianship figures - where a family or social work applies to take care of someone who is incapacitated - are also up, by 58 per cent to 2,115 in a year.

Social work pressures were highlighted by the commission, with only one-fifth of such cases receiving six-month checks from specialists. More children are also being admitted to non-specialist units due to the strain on resources.

The commission has called on the Scottish Government to take urgent action and devise a ­strategy to recruit and retain specialist social workers.

Colin McKay, MWC chief executive, said the system is heading for a meltdown as more people are admitted to hospital for mental help and the number of mental health officers - who are specialist social workers - drops.

He said: "While there are some positive signs, it is clear that the mental health officer service is under tremendous pressure. This needs urgent action by Government to ensure that ­Scotland's progressive mental health legislation works as it is intended."

Mr McKay said mental health care is "increasingly under strain and under-resourced". He added: "If this goes on the system is going to collapse. Over the next few years it is difficult to see how the trend could keep going up without something happening."

The commission's lead doctor, Dr Gary Morrison, said: "Given the projected demographic in Scotland over the next 20 years if this is sustained it might have distorting effect in terms of the use of the Mental Health Act 2003."

Separate figures showed a decrease in mental health officers in Scotland of more than three per cent in a year to 674. This was due to retirement in cases, although an increased workload was blamed for some staff departures.

The Scottish Social Work ­Council said the number of mental health officers on out-of-hours rota duty is at an "all-time low" with fewer than 100 for the whole country.

The commission also said it was concerned about the rise in the number of children with mental health problems being admitted to non-specialist wards, including adult wards in many cases.

This was up to 202 from 177 last year and was partly blamed on space pressure but also as a preferred option for some cases either geographically or because of the nature of the illness.

A spokesman for Unison said it was "aware of and concerned by the increasing amount of people who require these services and the reducing staffing levels and are working actively with the Scottish Government to try to make sure that services are fit for purpose".

A Scottish Government spokesman said: "We are disappointed to see that the number of young people being admitted to adult wards has increased. While it is true child and adolescent services are seeing and treating more young people, we expect NHS boards to be working to ensure young people are only admitted to an adult ward in exceptional circumstances. We are working closely with boards to identify ways to help address this problem.

"Local authorities are responsible for ensuring they have sufficient mental health officers to carry out their responsibilities.

"We note the increase in welfare guardianship orders … Where such orders are in place however they serve to safeguard the welfare of an adult with incapacity."