Dr Andrew McLellan, Scotland's chief inspector of prisons, says in a report on Saughton jail in Edinburgh that he was "concerned" to find more inmates with mental-health problems, and said there was a lack of specialist staff to offer treatment.
"This theme is emerging in several prisons," he said.
The Scotsman can reveal the problem has become so serious that the first full-scale inspection of mental-health issues in prisons will be carried out this year.
Mr McLellan said: "At the moment, the evidence that things are getting worse is very much anecdotal. The inspection will aim to get a better handle on the scale of the problem. But it is there - I have seen it with my own eyes.
"There is an ever-increasing number of people with mental-health issues across a range of things, from anxiety and depression to schizophrenia and other psychotic incidences.
"We are also seeing an increase at the serious end of things. Prison is the worst place for any hope of any change in their condition."
He said most prisons had increased their provision of mental-health services and were receiving more psychiatry support from outside.
An earlier recommendation that support for prisoners with mental-health problems should be improved has been "partly implemented" with the appointment of a second mental-health nurse, according to his report.
"But the prison environment is not conducive to therapy," he told The Scotsman.
"Prison officers are skilled people, but they are not trained to deal with people who are very, very disturbed."
Mr McLellan said the inspection would seek to discover the reasons for the big increase in serious mental-health cases in prisons.
More than 110 suicides have occurred in Scottish prisons in the past ten years. Cornton Vale, Scotland's only women's prison, was hit by a spate of suicides in the late 1990s; they hit a peak of 17 per year.
Since then, initiatives have successfully reduced the suicide rate there. But an inspection of the prison two years ago found that 80 per cent of inmates suffered mental-health problems and Mr McLellan's report has now raised fears that suicide rates across all prisons could rise.
Charlie McMillan, the director of research, influence and change at the mental-health charity SAMH, said he feared Scotland was returning to the days of the mental asylum.
He said: "This is a real worry. We are not dealing with people's problems or issues - we are just locking them up. It's inhuman and utterly wrong. The risks are huge in terms of isolation, suicide, self-harm and family breakdown."
He said the relationship between offending behaviour and mental health was a "chicken and egg one".
He welcomed the inspection but insisted: "If people are experiencing serious mental-health problems the last thing you need is to be locked up in prison. You're never going to get the treatment you need."
He added: "Society turns a blind eye to this because they think people with mental-health problems are a danger, but the vast majority are not a danger to anyone."