Most of the global population live in low-income and middle-income countries (LMICs), which have historically received a small fraction of global resources for mental health. The COVID-19 pandemic has spread rapidly in many of these countries. This Review examines the mental health implications of the COVID-19 pandemic in LMICs in four parts. First, we review the emerging literature on the impact of the pandemic on mental health, which shows high rates of psychological distress and early warning signs of an increase in mental health disorders. Second, we assess the responses in different countries, noting the swift and diverse responses to address mental health in some countries, particularly through the development of national COVID-19 response plans for mental health services, implementation of WHO guidance, and deployment of digital platforms, signifying a welcome recognition of the salience of mental health. Third, we consider the opportunity that the pandemic presents to reimagine global mental health, especially through shifting the balance of power from high-income countries to LMICs and from narrow biomedical approaches to community-oriented psychosocial perspectives, in setting priorities for interventions and research. Finally, we present a vision for the concept of building back better the mental health systems in LMICs with a focus on key strategies; notably, fully integrating mental health in plans for universal health coverage, enhancing access to psychosocial interventions through task sharing, leveraging digital technologies for various mental health tasks, eliminating coercion in mental health care, and addressing the needs of neglected populations, such as children and people with substance use disorders. Our recommendations are relevant for the mental health of populations and functioning of health systems in not only LMICs but also high-income countries impacted by the COVID-19 pandemic, with wide disparities in quality of and access to mental health care.