The institution has announced fees of £9,000 a year for “rest-of-UK” students in 2012-13, along with what it described as a “comprehensive” package of bursaries and financial aid.

That brings the cost of St Andrews’ four-year degrees to £36,000.

The University of Aberdeen and Heriot-Watt University have also announced fees of £9,000 for rest-of-UK students. However, they have pledged to only charge for the first three years of their degrees.

Glasgow Caledonian University is the only Scottish institution to date to announce fees of under £9,000: it plans to charge £7,000 a year for three years with the final year free – an average yearly cost of £5,250 for its four-year courses.

Students from Scotland and other European Union nations will continue to be exempt from fees.

Louise Richardson, principal and vice-chancellor of St Andrews, argued that the fees were lower than the cost of teaching.

“We are not a wealthy institution,” she said. “In spite of our age and our international standing, our endowment is remarkably small. Quite simply, we cannot afford not to charge £9,000.”

However, Robin Parker, president of the National Union of Students Scotland, accused St Andrews of joining a “farcical battle” over fees.

He said: “By setting the price of a degree at £36,000, another Scottish university principal has failed their students.

“St Andrews and Edinburgh are making it clear to students from the rest of the UK that it’s not their academic ability but the size of their parents’ bank accounts that really matters.”