Legislation is to be introduced to prevent students from the rest of the UK from exploiting dual nationality rights to avoid paying fees at Scottish universities.

Scottish students do not have to pay tuition fees while rest of UK students face paying up to £9,000 each year.

Under European law, European Union (EU) students from outside the UK must be treated the same way as local students, meaning they are also exempt from fees.

This loophole has led to speculation that thousands of applicants from Northern Ireland could use their rights to citizenship in the Republic of Ireland to avoid paying fees.

Everyone born in Northern Ireland is eligible for a Republic of Ireland passport under the terms of the Good Friday Agreement.

Under new legislation, dual nationality university applicants from the rest of the UK will be required to prove that they have previously exercised their right of EU residency in order to qualify as an EU student.

They will have to show evidence of having lived in another EU member state for at least three months before qualifying to have their tuition fees paid. The legislation will come into effect from 2013/14.

The Scottish Government said the move was designed to ensure a consistent approach across all universities and insisted there was little evidence to suggest the loophole was being exploited.

Education Secretary Michael Russell said: "Since the very recent changes to tuition fees system there is little or no evidence of changes in the make-up of applicants.

"However, speculation over the opportunity for prospective students, resident in the rest of the UK, seeking another EU nationality to avoid paying fees has caused confusion.

"This legislation will require dual-national students to provide evidence that they have previously exercised their right of residence elsewhere and will prevent the use of dual-nationality solely to benefit from free tuition.

"We have today issued guidance to universities that will ensure a consistent approach across Scotland and provide clarity for students."

Professor Pete Downes, convener of Universities Scotland, said: "Universities very much welcome this action from the Scottish Government.

"It's important that students have access to reliable and consistent information on fees and financial support when applying to university in Scotland, and we trust the forthcoming legislation will provide exactly that.

"Despite much speculation, Scotland's universities have not seen a large influx of applicants from Northern Ireland looking to exploit the loophole.

"However, it is necessary to take action to close it for future years to avoid any confusion for students and parents alike.

"Every university in Scotland is proud to welcome students from across the UK and further afield to study here, but what attracts them must continue to be the quality of the education we can offer."