Prisoners with mental health problems should be treated in specialist units rather than be locked up in jails, the Chief Inspector of Prisons has said.
Some inmates are being made worse by prison - inspector
Almost two prisoners kill themselves a week in jails in England and Wales, Anne Owers says in her annual report.
Women, new arrivals, drug users and the mentally ill are most at risk of
self-harm and suicide, she added.
Prison Service Director General Phil Wheatley said such units would take a substantial problem out of prisons.
Ms Owers told BBC Radio 4's Today Programme: "It is quite clear that there are people in prison who don't need to be there and who are being made worse by being in prison and who could benefit from other provisions outside prison."
New mental health units needed to be built so that prisons could care for the people that ought to be there, she added.
Although Mr Wheatley appeared to support the idea, he said it was not his job to second-guess what the courts should do.
"What we have got to do is to improve the conditions and the treatment of those who are sent to us and we're trying to improve the mental health care we offer to prisoners," he said.
The call comes after figures for 2003 showed there had been 94 prison suicides in total, one less than in 2002 but up on previous years.
Cases of self-harm went up by 30%, with 7,700 men and women deliberately injuring themselves in the first six months of 2003.
Ms Owers blamed overcrowding, saying the escalating prison population was having an "insidious and chronic" effect on prisons.
The chief inspector was also very concerned about women who she said were particularly badly served by the prison system.
"The needs of women are acute and in danger of being neglected or disregarded," she concluded.
But there was a significant increase in female suicides with 14 women prisoners taking their own lives in 2003, up from nine the previous year.
Women were more likely to self-harm than men, the report said, with a large proportion hurting themselves in the first month of their sentence.
With 25% of women self-harming in local prisons, Ms Owers said: "This is an indicator, if one were needed, of the extreme levels of distress among women in prison."
The report highlighted the failure of many prisons' drug detoxification schemes.
It said 80% of prisoners were suffering from substance misuse when they arrived in custody.
Ms Owers said the presence of successful detoxification projects was "inexcusably patchy".
At Styal prison in Cheshire, the report found that inadequate detoxification severely affected women's physical and mental health and future chances.
Ms Owers said: "It is inexcusable, that, 18 months after our inspection, this was still not the case, and in the interim six women drug-users had died there within a month of admission."
Six women drug users killed themselves at HM Styal last year
In response the Prison Service pointed out the scale of the problems it faces.
It said that 90% of all prisoners have a diagnosable mental health problem, substance abuse problem or both.
A range of initiatives were being developed to ensure that mentally-ill people who come into contact with the criminal justice system receive appropriate care in the right setting, it pointed out.
Meanwhile, director general Mr Wheatley said that links to the NHS had been considerably improved and prisoners were being transferred to mental health hospitals faster than in the past.
But the chief executive of mental health charity Sane, Marjorie Wallace, called on Mr Wheatley to provide proof prisoners are getting psychiatric care, saying "our experience is that they are not."
Community mental health charity Maca said that, while it broadly welcomed Ms Owers' recommendations, "single-service solutions" like the suggested specialist mental health units would not go far enough in removing the problem.