Learning a second language can help improve a person's thinking skills, a new study has suggested.

Researchers compared 200 modern languages and humanities students to assess the impact of learning a second language.

They looked at 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.

The Edinburgh University researchers 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.

They found that students who learned a second language were better at switching attention to filter relevant information.

Students of humanities, who were investigated in first and fourth year as a comparison group, had improved in letter fluency - the ability to produce words starting with a certain letter - but their improvement in switching attention was smaller than those of language students.

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."

He added: "While there were not too many differences between the two groups at the beginning, the fourth years showed a significant improvement.

"In the humanities it was in letter fluency as if you are reading a lot of texts you have a better vocabulary, and are better at starting words with a certain letter.

"The languages students not only improved their language skill, they also improved in "attentional" tests.

"I think it shows the benefits of any kind of academic study because the students of humanities improved as well.

"But the interesting thing about learning a language is that it also gives you some advantages in attentional function, and you stimulate a lot of functions in the brain."

The study, which was carried out over a few months, is published in the journal Cognition.

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.

Whereas the previous studies concentrated on ageing, the present one focuses on young adults who started learning their second language at the university.

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