Mental health is a growing public health priority and human rights imperative. As a result, increasing numbers of countries are adopting or reforming mental health-related legislation. Existing legislation often fails to address the social and economic factors that affect mental health, and can thereby perpetuate discrimination and human rights violations, such as denial of legal capacity, coercive practices, institutionalization, and poor-quality care, including in mental health care settings. In response, the World Health Organization (WHO) and the Office of the United Nations High Commissioner for Human Rights (OHCHR), among other international stakeholders, are actively advocating for a human rights approach to mental health. The international human rights framework, particularly the Convention on the Rights of Persons with Disabilities (CRPD), calls for a significant shift from biomedical approaches towards a support paradigm that promotes personhood, autonomy, and community inclusion. This joint WHO–OHCHR publication, Mental health, human rights and legislation: guidance and practice (hereinafter, “the Guidance”), aims to assist countries in adopting, amending, or implementing legislation related to mental health. Its objective is to ensure that mental health policies, systems, services, and programmes provide high-quality care and support for all, in line with international human rights standards, including the CRPD. The Guidance encourages the integration of mental health into general legislation rather than the adoption of mental health-specific laws. The Guidance is intended for legislators, policy-makers, and professionals involved in mental health legislation and care. It may also be helpful to those working in related fields, such as United Nations entities, government officials, persons with mental health conditions and psychosocial disabilities, professional organizations, family members, civil society organizations, organizations of persons with disabilities, humanitarian workers, community-based organizations, faith-based organizations, researchers, academics and media representatives. The Guidance has three chapters and a checklist covering the process and content of ensuring rights-based legislation: Chapter 1 discusses the challenges associated with current mental health legislation and highlights the need for reforms that align with the international human rights framework. Chapter 2 describes the main principles and issues that legislation on mental health should incorporate, with examples of rights-based provisions. Chapter 3 explains how to develop, implement, and evaluate mental health-related legislation following a rights-based process. Checklist for countries to evaluate whether their legislation adopts a rights-based approach.