The government has bowed to pressure over its controversial plans to detain untreatable mentally ill people by agreeing extra safeguards on powers.
The bill calls for people with severe personality disorders to be held
It had faced opposition from MPs and campaigners to its Mental Health Bill, which would allow people to be detained to protect themselves or the public.
It has agreed to a compromise proposal ensuring that any compulsory treatment must be of "therapeutic benefit".
The bill gained its third reading by 272 to 202 votes, a majority of 70.
It now returns to the House of Lords, where a string of defeats has already been inflicted on the government, to consider MPs' amendments.
Labour MP Chris Bryant suggested the "treatability test" compromise during a two-day Commons debate.
He said psychiatric units should not become "prisons by another name" and added that mentally ill people had the right to appropriate treatment.
"We cannot simply wash our hands of them. We cannot just be detaining people for the purpose of detaining them. There has to be some kind of therapeutic benefit," he said.
The Tories welcomed the move and Health Minister Rosie Winterton told MPs that mental health organisations had urged her to back the amendment.
She said it was a good compromise, as it was based on the purpose of medical treatment - "it does not turn on the likelihood of treatment achieving that purpose".
Ministers have been trying to update mental health laws since 1998.
The bill, which would allow people with severe personality disorders to be detained, if judged to be a threat, was introduced after several high profile murders involving people suffering from mental health problems.
The government says it balances the need for treatment with public safety, but it has been criticised for being too draconian.
The Tories also wanted an "impaired decision making" test put into the bill, to ensure that patients who retained the capacity to decide their own treatment should have their wishes respected.
Shadow health minister Tim Loughton said: "What that does is to acknowledge that suffering from a mental disorder doesn't automatically mean that someone isn't fully able to make decisions.
Series of amendments
That was supported by Labour MP Lynne Jones and Lib Dem MP Evan Harris, who said it allowed for people who, while mentally ill, were rational in deciding they did not want medical treatment.
But Ms Winterton said it would leave potentially dangerous people to be dealt with by the criminal justice system and the amendment was defeated.
The government has already outlined a series of concessions in an effort to get it through Parliament. Ministers have been trying to update mental health legislation since 1998.
They include new plans to give people detained under mental health laws access to advocacy services and to allow under-18s held in adult institutions to be treated in "age appropriate settings".
But they have stuck by the plans to allow doctors to issue supervised community treatment orders, which would force patients to take medicine and place them under detention if required.
The shake-up in the law has been driven by Michael Stone's 1998 conviction for the murders of Lin and Megan Russell.
Stone was regarded as a dangerous psychopath and it had been assumed he was not held under mental health powers because his condition was considered untreatable.
This was subsequently found not to be the case as he was receiving treatment but gaps in his care meant he was not given the correct treatment.