An independent review of Scotland's mental health legislation is to be carried out, ministers have announced.
Mental health care in Scotland is currently underpinned by laws which date back to 2003, and MSPs have faced calls for an update.
The government said a special review group would examine the latest developments in care and treatment.
The "ambitious" move was welcomed by the Mental Welfare Commission and opposition parties at Holyrood.
It follows on from work already under way to review incapacity law and practice and a review of learning disability and autism.
The chairperson of the review group is to be announced in due course, while the study itself is expected to take roughly a year.
The Mental Health (Care and Treatment) (Scotland) Act 2003 was designed to strengthen the rights and protections of people with mental illnesses, learning disabilities and personality disorders, placing duties on local councils to provide care and support services for them.
A petition had been lodged at Holyrood urging ministers to "conduct a wide review" of legislation, in light of developments both in care and treatment and international human rights law.
Mental Health Minister Clare Haughey told MSPs that "the time is right" to review the law, to make sure that rules "fully reflect our ambitions and the needs of those our laws are intended to support".
She said: "The Scottish government is absolutely committed to bringing change to people's lives and ensuring that mental health is given parity with physical health.
"As part of the review we want to gather views from as wide a range of people as possible and I am determined to ensure that the views of service users, those with lived experience and those that care for them are front and centre so they can help shape the future direction of our legislation."
Opposition parties welcomed Ms Haughey's Holyrood statement, saying the 2003 Act had been "groundbreaking" at the time but was now in need of an update.
Colin McKay, chief executive of the Mental Welfare Commission, said the group would support the "ambitious project" in any way it could.
He said: "Working together with professionals and with people with lived experience, Scotland has the opportunity to create new legislation that can bring real improvement to the care and treatment of some of the most vulnerable members of our community."