COURSES at Scottish universities are facing the axe as a result of Brexit because they rely on EU students, principals have warned.

Data from the Higher Education Statistics Agency shows key courses at both undergraduate and postgraduate levels may no longer be viable if numbers of EU students dry up.

Unless universities can find students from elsewhere to plug any gaps then subject choice is likely to suffer for all students - including Scots.

Read more: Beyond Brexit - Scottish universities seek new global partners to offset Brexit "calamity"

At undergraduate level there are 32 courses at Scottish universities where more than one third of students come from EU countries, 22 where they make up more than 40 per cent and seven where they represent more than half.

Subjects affected include computer science, science, technology, engineering and maths, genetics, politics, economics, business and law.

At postgraduate level there are 20 subjects where EU students make up more than a third of all students, 10 where they represent 40 per cent and two where they represent more than half. Subjects include business, some agriculture, physics, languages and creative arts.

Professor Sir Tim O'Shea, principal of Edinburgh University, said: "One of the reasons some Scottish universities are so concerned about the future pattern of EU students is that in some quite important areas it is the students from the EU that is ensuring that key subjects have enough highly qualified students to study them.

"There is a concern that these changes might result in some Scottish university courses becoming unviable in the sense that there would not be enough university students to teach."

Alastair Sim, director of Universities Scotland, which represents the sector, said EU students were important educationally, culturally, economically and numerically.

Read more: Beyond Brexit - Scottish universities seek new global partners to offset Brexit "calamity"

He said: "It will be important to work out a way to ensure they remain part of our community in sustainable numbers because a sudden loss of EU students could send shockwaves through certain subjects across our universities.

"At degree level the demand for places amongst deserving Scots far outstrips supply so there are opportunities, but that demand is unlikely to map perfectly to all subjects within which EU numbers decline.

"Any transition needs to be managed carefully and gradually, but if EU students lose their freedom of movement after Brexit and fewer choose Scotland in the future this could limit student choice for our home students."

Universities have already expressed concern that an end to the free movement of citizens from other EU countries post Brexit will lead to a decline in European students.

In 2014/15 there were more than 13,000 EU nationals studying an undergraduate degree here and some 7,000 postgraduates.

Mary Senior, Scottish Officer for the UCU lecturers' union, called for the Scottish Government to use new national links they have been forging with EU member states and other countries to create further mobility options for EU students to ensure numbers were preserved.

She said: “The Brexit vote has resulted in uncertainty across the whole higher education sector generally, but it’s important for universities not to take short-sighted decisions based on worse case scenarios, and instead plan for the long term future of all subjects.

Read more: Beyond Brexit - Scottish universities seek new global partners to offset Brexit "calamity"

"High proportions of EU students in some subjects just now doesn’t mean there’s not a demand for those places from prospective students from elsewhere, including Scotland or that many EU students won’t continue to come to Scotland.

"With proper planning we can ensure the viability of our universities without cutting courses. Making cuts would do nothing other than harm the global reputation of the sector in Scotland and it’s exactly that reputation which is the key to weathering the storm the sector has been placed in."