Massive rises in heroin and methadone-related illnesses and drug problems amongst over-40s have driven drug-related hospital stays to a record high, official figures show.

The number of hospital stays linked to opioids, of which the main street drug is heroin, have risen fivefold from 791 in 1996/97 to 4,511 in 2014/15.

The rate of opioid-related admissions per head of population has risen even faster, from around 10 per 100,000 population to almost 90, figures from NHS Scotland's Information Services Division (ISD Scotland) show.

There were almost as many hospital stays linked to opioid use as there were for alcohol dependence (4,747) in 2014/15.

Overall, there were 133 hospital stays per 100,000 associated with drug misuse in 2014/15, up from 41 in 1996/97.

This is the highest recorded rate since recent records began in 1996/97.

Drug-related hospitalisations have remained steady amongst under 25s, but have been rising for all age groups beyond that with the largest increases seen in over 40s.

There has been an elevenfold increase in admissions of those aged 40-44, from 20 per 100,000 to 236.

There was an even bigger fifteenfold increase amongst 45-49 year olds from 11 per 100,000 to 166, while admissions of those aged 50-54 have increased by a factor of 12 from seven per 100,000 to 84.

The link between deprivation and drug misuse is becoming even more pronounced, with half of drug-related admissions coming from the 20% most deprived areas.

While admissions have been rising amongst all social classes, the increases in hospital stays from the poorest 40% have been sharper than those from the more affluent areas.

There has been a gradual rise in new drug patients over the last decade from 43 per 100,000 to 54.

Male and female patients have both increased threefold but the ratio has remained the same, with twice as many male drug users ending up in hospital than women.

Last week, government-appointed researchers revealed that Scottish authorities do not understand why Scotland has one of the highest drug death rates in the world.

The Scottish Government's Problem Drug Use and Recovery Steering Group identified "long-standing gaps in terms of the availability of effective information systems and relevant research", despite a number of interventions and calls for evidence in recent years.

Seven years on from the Scottish Government's Road to Recovery plan and two years after the Drugs Strategy Delivery Commission called for a national research programme, the researchers found "major unresolved challenges in Scotland, where drug death rates are one of the highest worldwide".

The Scottish Government stressed that "fewer Scots are taking drugs", noting a 1.4% fall in reported use since 2008, and said drug taking among young people "is at its lowest level in a decade".

Heroin, methadone and codeine are among the drugs classed as being in the "opioid" category.