The government has suffered three defeats in the House of Lords over plans to detain mental health patients who have not committed an offence.
Enforced treatments could be 'highly invasive', peers heard
The Mental Health Bill would allow people with severe personality disorders to be confined if judged a threat to themselves or others.
Peers voted that treatment could only be given if it is likely to help.
They also voted to remove some grounds for diagnosis and ensure more frequent examinations of detained patients.
Critics argue the bill is draconian and could prevent some people from coming forward to seek treatment.
But Health Minister Rosie Winterton said: "Every barrier that is put in the way of getting treatment to people with serious mental health problems puts both patients and the public at risk.
"We believe that this bill strikes the right balance between getting treatment to those who need it, putting in place patient safeguards and minimising the risk to the public."
Conservative, Lib Dem and non-aligned peers jointly tabled a series of amendments to the plans.
In the first government defeat, the Lords voted to rule out using sexuality, criminality and cultural or religious beliefs as grounds for diagnosing a mental disorder.
The second inserts an amendment that treatment can only be given if it is likely to alleviate the condition or prevent it getting any worse.
The third says that patients' detentions can only be renewed after they are examined by a medical practitioner.
Tory Earl Howe told peers: "It [the bill] allows individuals who have committed no crime to be detained and committed under compulsion and subjected to treatments that are highly invasive."
He added it was essential to "set the parameters of acceptable behaviour on the part of health professionals".
Patients who were coerced felt "dreadful trauma and deep humiliation", Earl Howe said.
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.
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.