The House of Lords has passed an amendment to Clause 39 of the health and social care bill.
Prior to the revision, the clause would have removed the duty of the NHS and local authorities to work together to help those leaving a psychiatric hospital.
This could have created a breakdown in treatment, with one provider capable of making changes without alerting the other.
Under the change, however, patients will continue to receive the help and support they need when returning to the community after receiving psychiatric treatment.
Paul Farmer, chief executive of mental health charity Mind, commented: "We warmly welcome the acceptance of this amendment, a decision which will help to ensure that people being discharged from hospital will continue to receive the vital support they need to rebuild their lives and stay well."
Mind claim that the change to Clause 39 is essential to help those detained under the Mental Health Act receive the required support, which they are often unable to secure for themselves.
Read about support and personalised care at Barchester care homes for anyone with mental health concerns.