The government's controversial Mental Health Bill, which allows people with serious personality disorders to be detained even if they have not committed a crime, has cleared its final hurdle.
Health minister Ivan Lewis has accepted a batch of minor amendments by the Lords, paving the way for it to be included in the statute books.
The new law means patients with severe mental health issues can be detained if they are judged to be a threat to themselves or others.
It comes after several high-profile murders involving people suffering from personality disorders, but critics claim its powers are draconian and too wide-ranging.
The move marks the end of the government's eight-year battle to introduce new mental health legislation.
It was forced to insert a number of changes into its original plans after peers inflicted a series of defeats over its provisions.
These include a compromise proposal drawn-up by Labour Rhondda MP Chris Bryant that introduces a new "treatability test" to ensure that compulsory treatment must be of "therapeutic benefit".
Mr Lewis said: "In spite of past disagreements, we have the same aim as those who have debated every step of this legislation with us: the timely and effective treatment of all who need it.
"I believe this will be seen as an historic piece of legislation which does represent the best interests of people with mental health needs and their families, but also ensures the community can have confidence in a modern mental health system."