Hundreds of genes have been newly linked to depression, shedding light on the origins of the condition and highlighting personality types that could be at risk.
The international study, involving more than two million people, is the largest of its kind. It could inform treatments for the condition, which affects one in five people in the UK and is the leading cause of disability worldwide.
Scientists led by the University of Edinburgh studied information pooled from three large datasets of anonymised health and DNA records and pinpointed 269 genes that were linked to depression.
They also used an innovative statistical method to identify sections of DNA that were common in people with depression and in those who adopted lifestyle behaviours such as smoking.
The findings suggest that depression could be a driving factor leading some people to smoke, but more research is needed to explain why, the team says.
Results also show that neuroticism - a tendency to be worried or fearful - could lead people to become depressed, which could shed light on personality factors that put people at risk.
The statistical approach - known as Mendelian randomisation - allows scientists to look at how a condition impacts on behaviour, while ruling out other influences such as age or income.
Anonymised data, used with donor consent, is held by UK Biobank, the personal genetics and research company 23andMe and the Psychiatry Genomics Consortium.
Experts say that the study reflects the importance of data science in understanding mental health and the leading role that Scotland plays in this field.
The team is inviting people with depression or anxiety in Scotland to take part in a further study, to understand more about the role of DNA in the common mental health conditions.
The research - known as The Genetic Links to Anxiety and Depression (GLAD) Study - aims to better understand depression and anxiety in order to improve the lives of people with mental health issues.
The team, working with colleagues at the National Institute of Health Research Mental Health BioResource and King's College London, hopes to collect saliva samples and questionnaires from 40,000 people across the UK.
Participants in the study will be offered the chance to take part in further mental health research.
The study, published in Nature Neuroscience, was funded by Wellcome and the Medical Research Council.
Professor Andrew McIntosh, of the University of Edinburgh's Centre for Clinical Brain Sciences, who led the research, said: "These findings are further evidence that depression is partly down to our genetics.
"We hope that by launching the GLAD study, we will be able to find out more about why some people are more at risk than others of mental health conditions, and how we might help people living with depression and anxiety more effectively in future."
Raliza Stoyanova, Wellcome's Senior Portfolio Developer for neuroscience and mental health, said: "This large study is an important advance in understanding how genetic variability might contribute to risk for depression. Given that current treatments work for only half of those who need them, the study provides some intriguing clues for future research to follow up - for example that biological pathways involved in developing the condition may not be the same as those involved in responding to treatment."
Sophie Dix, Director of Research at mental health charity MQ, who was not involved in the research, said: "This study adds to the weight of evidence that genes are one of the key risk factors in depression, which is also impacted by life events such as social environment and trauma. The value of this could really be seen when looking into the development of personalised treatments - a welcome step given the dearth of innovation in identifying new approaches. We have seen very little advancement in nearly 50 years for people living with depression and right now the avenues available are not working for everyone.
"The power of this big genetic study is that it can point to systems in the brain which adds to our currently limited understanding in this area. By increasing our understanding of these systems, and how the social environment affects biological risk factors, we can begin to identify new targets for treatments that could help the millions of people worldwide affected by depression."
To sign up for GLAD or find out more, please visit https://gladstudy.org.uk/scotland/