Researchers led by the University of Edinburgh have discovered how humans - and other mammals - evolved to have intelligence.
They found that intelligence in humans developed as the result of an increase in the number of brain genes in our evolutionary ancestors.
Scientists also believe that the same genes that improved our mental capacity are also responsible for a number of brain disorders.
The researchers suggest that a simple invertebrate animal living in the sea 500 million years ago experienced a 'genetic accident', which resulted in extra copies of these genes being made.
This animal's descendants benefited from these extra genes, leading to behaviourally sophisticated vertebrates - including humans.
"One of the greatest scientific problems is to explain how intelligence and complex behaviours arose during evolution," Professor Seth Grant, of the University of Edinburgh, who led the research, said.
More From This Section
The research, which is detailed in two papers in Nature Neuroscience, also shows a direct link between the evolution of behaviour and the origins of brain diseases.
"This ground breaking work has implications for how we understand the emergence of psychiatric disorders and will offer new avenues for the development of new treatments," said John Williams, Head of Neuroscience and Mental Health at the Wellcome Trust, one of the study funders.
The research team studied the mental abilities of mice and humans, using comparative tasks that involved identifying objects on touch-screen computers.
Researchers then combined results of these behavioural tests with information from the genetic codes of various species to work out when different behaviours evolved.
They found that higher mental functions in humans and mice were controlled by the same genes.
The study also showed that when these genes were mutated or damaged, they impaired higher mental functions.
"Our work shows that the price of higher intelligence and more complex behaviours is more mental illness," Grant said in a statement.
"We can now apply genetics and behavioural testing to help patients with these diseases," said Dr Tim Bussey from Cambridge University, which was also involved in the study.