Prison should be used only for those who have committed the most serious crimes, Scotland's chief inspector said as he welcomed figures showing the number of inmates is at its lowest level for almost a decade.

David Strang said he has met "too many people" in prison with mental health or addiction problems who cannot get the treatment and care they need.

In his annual report, the chief inspector of prisons supports extending the presumption against short prison sentences, greater use of non-custodial sentencing to encourage community payback, increased diversion from prosecution in appropriate cases, and the extension of the use of electronic monitoring - particularly to reduce the number of unconvicted prisoners held on remand.

Mr Strang described a fall in the prison population from 7,731 in 2014-15 to 7,675 in 2015-16 as "encouraging", and highlighted challenges for prisons in providing healthcare and support, particularly for a growing number of older men jailed for historical sexual offences.

Poor communication between agencies when people leave prison can also "create unnecessary barriers to a constructive and positive life where the likelihood of reoffending is reduced", Mr Strang said.

Inspectors visited HMP Dumfries, HMP Addiewell, HMP & YOI Cornton Vale, HMP & YOI Grampian and the HMP Open Estate over the last year.

Mr Strang said: "We should be encouraged that the apparently inevitable and steady increase in the total prison population in Scotland over the last two decades continues to show signs of being halted and potentially stabilised.

"The daily average population for 2015-16 was 7,675 in comparison with 7,731 for 2014-15. This was itself the lowest daily average population since 2007-8.

"That there are fewer young men in HMYOI Polmont than there were a decade ago continues to provide grounds for encouragement.

"While these statistics are encouraging, I believe that more still needs to be done to reduce the prison population.

"Compared to other European countries, Scotland still imprisons approximately 50% more than the average and about twice those that imprison the fewest.

"I meet too many people in prison with mental health problems, addicted to alcohol or drugs, who are vulnerable to self-harm or suicide.

"Prison is not the right place for many of them to receive the treatment and care that they need.

"I would like to see prison used more sparingly, reserved only for those who have committed the most serious crimes or pose a serious risk to others."

A lack of places in open prisons and parole leave was also criticised, but Mr Strang praised the work of prison officers around the country in his annual review.

He said: "We should never take for granted that Scotland's prisons are in general well-run, ordered and stable places. It is to the credit of the men and women working in prisons that most prisoners say that they feel safe and that they are treated with dignity and respect.

"The vast majority of staff are dedicated, hard-working and committed professionals.

"We should not underestimate the challenge that working in a prison presents. Staff are looking after some of the most dangerous people in Scotland and also some of the most vulnerable.

"It is a challenge for the prison to meet the needs of all prisoners, which are often complex and at times competing. It can be a demanding and difficult job, requiring the constant assessment of risk, a need to be alert, knowledgeable, firm and flexible.

"The best combine these qualities with care and compassion."