Lib Dem Baroness Barker said a "clear statement of principles" on how the law and mental health workers' code of practice worked together was needed, to avoid "continued confusion".

The slimmed-down Mental Health Bill is the latest in a series of attempts by the government since 1998 to change the laws.

Community treatment

At the moment people cannot be detained against their will - even if they are a danger to themselves or others - if that detention and treatment cannot be shown to benefit their condition.

The government wants to change those rules so people can be detained and treated if medical treatment, which is appropriate to the patient's mental disorder "and all other circumstances of their case", is available.

Also controversial is the plan to bring in supervised community treatment, which aims to ensure patients comply with their treatment once they are discharged from hospital.

The bill comes after previous attempts to change the existing Mental Health Act 1983 were abandoned in the face of opposition from mental health campaigners and some doctors.

They object, among other issues, to the bill being too occupied with public safety rather than the needs of the people who might require help.

The peers say they do not want the bill dropped, but want their amendments accepted by the government.

The government will have to decide whether to reverse the defeats when the legislation goes to the Commons.

The bill would affect an estimated 14,000 of the 600,000 people who use mental health services each year.