Mental health nurses are to be posted in police stations and courts in a bid to reduce reoffending by mentally ill criminals.
The £25 million pilot scheme, which is to be tested in 10 areas across England, will mean that people with mental health problems are treated "as early as possible", care and support minister Norman Lamb said.
Identifying people with mental health needs who come into contact with the criminal justice system at the earliest possible stage will help to "divert" them away from offending again, Mr Lamb said.
He said that "too often" criminals with mental health problems, learning difficulties or substance misuse issues are only diagnosed once they reach prison.
The majority of people who end up in prison have a mental health problem, a substance misuse problem or a learning disability, and one in four has a severe mental health illness such as depression or psychosis, a Department of Health spokeswoman said.
Over the next year, the money will be used to join up police and courts systems with mental health services in Merseyside, London, Avon and Wiltshire, Leicester, Sussex, Dorset, Sunderland and Middlesbrough, Coventry, south Essex and Wakefield.
Mentally ill people as well as those with substance abuse problems and learning disabilities, will be assessed when they come into contact with police. The information will be shared with officers and the courts system to ensure charging and sentencing decisions take into consideration a person's health needs, the spokeswoman said.
It will also mean treatment is given sooner which will help stop reoffending, she added.
If the pilot is successful , the measure will be rolled out across the rest of the country by 2017.
Mr Lamb said: "We want to help them get the right support and treatment as early as possible. Diverting the individual away from offending and helping to reduce the risk of more victims suffering due to further offences benefits everyone.
"That's why we are investing £25 million for liaison and diversion services at police services and courts across the country. These will help identify when someone in a police station or involved in court proceedings who has mental health problems are referred to the right mental health services and are given the help and support they need."
Policing minister Damian Green said: " Police officers should be focused on fighting crimes and people with mental health conditions should get the care they need as early as possible.
"These pilots will not only ensure that happens but in the longer term will help drive down reoffending by individuals who, with the right kind of treatment, can recover fully."
The move follows a similar scheme which sees nurses on patrol alongside police officers in a bid to improve responses to mental health emergencies.
Street triage teams are being tested across police forces in North Yorkshire, Devon and Cornwall, Sussex, Derbyshire, West Yorkshire, the West Midlands, Thames Valley and London, as well as British Transport Police.
As well as supporting police on patrol, the mental health nurses also assist officers when they are responding to emergency calls and give advice to staff in police control rooms.
The pilot mimics schemes already established in Leicestershire and Cleveland, which have shown that having nurses on hand can help to reduce the number of mentally ill people taken into custody and reduces demands on police time.
It has been estimated that police officers spend 15% to 25% of their time dealing with mental health problems - the equivalent of around 26,000 officers.
Paul Jenkins, chief executive of charity Rethink Mental Illness, said: "All too often, the way our criminal justice system deals with people with mental health problems leads to poor outcomes for individuals, frustration from police officers, magistrates and others, and such a waste of resources as people are needlessly sent to prison through a failure to respond to some of the underlying issues in their lives.
"We welcome this initiative, which has the potential to stop people going unnecessarily to prison, reduce reoffending rates and save millions in taxpayers' money.
"This scheme may not be a panacea but these liaison and diversion teams are definitely the best opportunity we've had to do things differently. Let's make sure we make the most of it."
Centre for Mental Health chief executive Sean Duggan said: " Liaison and diversion teams provide immediate advice and help to the police when they arrest someone with a mental health difficulty. They can screen for mental health problems and learning difficulties in both adults and children who come into police custody and secure the right support for those who need it.
"Well functioning liaison and diversion services can prevent people with mental health problems from being imprisoned and reduce the likelihood of further offending by putting better support plans in place for people with complex needs.
"We are pleased that the Government has given the go-ahead to further development of liaison and diversion services. This year it will be five years since the Bradley Report was published and it is vital that good quality mental health support for adults and children alike is available in every police station and court in England."
Marylyn Haines Evans, chairwoman of the National Federation of Women's Institutes, said: "The Care not Custody campaign has been very close to the hearts of many WI members. The commitment to extend the pilot scheme is an important step towards the coalition government's delivery of its care not custody promise, building on the positive commitments made in 2011.
"For too many years diversion has been an afterthought and too many people who should be diverted from police stations and courts into mental health or social care settings are ending up in prison as a default option. This is nothing short of a scandal.
"We now have a good foundation for change and we're starting to see the alignment of health and criminal justice systems that is critical to stop the cycle of offenders with mental health problems moving in and out of the prison estate. We are encouraged by today's announcement."
Juliet Lyon, director of the Prison Reform Trust, said: "The determination of the WI is driving ministers to do the right thing and divert vulnerable, mentally ill people away from bleak prison environments into the care and treatment they need.
"Between us, and with the backing of a coalition of professional bodies representing over two million people across the health, social care and justice sectors and wider civic society, we can make sure the government keeps to its care not custody promise."