Learning a second language can boost general thinking skills, a study suggests.

Tests carried out on 200 students of modern languages and humanities suggest that learning a second language improves a person's mental agility.

Researchers assessed different aspects of mental alertness, such as concentrating on certain sounds, switching between counting upwards and downwards, as well as the ability to produce different words.

They then compared the results of first year students - who had just started to learn a language - with those of fourth year students who had reached a high level of proficiency.

The researchers found that students who learned a second language were better at switching attention to filter relevant information. Students of humanities, who were investigated as a comparison group, had improved in letter fluency - the ability to produce words starting with a certain letter, but their improvement in attention switching was smaller than those of language students.

The team at the University of Edinburgh who conducted the study say the results confirm the cognitive benefits of learning in general and language learning in particular.

The research builds on two previous studies by The University of Edinburgh. The first suggested that speaking a second language can improve thinking skills in later life. The second shows speaking more than one language can help delay the onset of dementia. But whereas the previous studies concentrated on ageing, the present one focuses on young adults who started learning their second language at the university.

Dr Thomas Bak, of the University of Edinburgh's Centre for Cognitive Ageing and Cognitive Epidemiology, said: "Our study demonstrates that learning languages is not only good for a person's career and social life, but also has beneficial effects on cognitive functions, which go well beyond the language itself."

The study is published in the journal Cognition.

The study authors, Thomas Bak, Mariana Vega-Mendoza and Antonella Sorace, are part of the team that make up Bilingualism Matters, a Centre at the University of Edinburgh delivering evidence-based information about bilingualism and language learning.