New students from EU countries will still be entitled to free university tuition on courses which start in 2020, the Scottish government has confirmed.
The arrangements will cover EU students for the duration of courses which begin next year. A Scottish university degree normally takes four years to complete.
EU students are currently entitled to the same free university tuition as Scots under European law.
However, students from other parts of the UK are charged tuition fees.
The government had already announced that new EU students who start their courses this year would get the same fee support as Scots for the entirety of their course.
In practice, that normally means free tuition.
The Scottish government said the same arrangements would apply to those whose courses started in 2020 even if the UK has left the EU by then.
The UK government hopes Britain will have left the EU by October 31.
Further and Higher Education Minister Richard Lochhead said Scotland was "open and welcoming" and he urged anyone thinking about their education to consider coming to Scotland.
"Brexit remains the greatest threat facing our colleges and universities and I hope that, in a time of uncertainty, this announcement will provide the clarity that our academic institutions need to plan for the 2020-21 academic year," he added.
Prof Andrea Nolan, the convener of Universities Scotland and principal of Edinburgh Napier University, said the move provided "much-needed certainty" for potential students and institutions.
She added: "Brexit uncertainty continues to loom large over universities so the fact that the Scottish government has acted decisively in the midst of that speaks volumes about Scotland's values and our desire to remain open and welcoming to the rest of the world."
The chief executive of Colleges Scotland, Shona Struthers, added: "There were approximately 16,000 non-UK EU nationals enrolled in Scottish colleges in 2016-17 and, as a sector, we recognise and value the significant contribution they make to our institutions and society, so we are determined to do all we can to continue attracting those students to colleges in a post-Brexit landscape."
At present undergraduate university students can be broadly split into three categories:
- Scots and students from EU countries outside the UK who do not pay tuition fees. They compete against each other for the same pool of places though, of course, the vast majority go to Scots.
- Students from other parts of the UK. They pay regulated tuition fees and universities can admit as many as they want.
- Students from countries outside the UK and Europe who pay uncapped fees. Again universities can admit as many as they want.
Some in universities argue that more places need to be made available to Scots to ensure that efforts to attract more students from disadvantaged backgrounds do not make it harder for others to get in.
Although many in universities oppose Brexit, some have argued that if Britain does leave the EU it would be better to eventually start charging new EU students fees so all the free places could go to Scots.