Scotland's oldest university has issued a warning that moves to recruit more pupils from disadvantaged backgrounds is discriminating against the middle classes.

St Andrews University, in Fife, also claimed the policy means students with better school qualifications are being pushed out.

The warning comes three years after the Scottish Government instructed all universities to increase the number of students from the poorest 40 per cent of communities.

A document setting out the Fife university's targets highlights an increase in the proportion of poorer students over the three years from 8.6 per cent to 13.5 per cent - a rise from 41 to 96 students.

However, the document states such students can have significantly lower academic tariff scores than other pupils, in part because of a lack of access to Advanced Highers.

It also highlights the fact the Scottish system of funding higher education from the public purse rather than tuition fees effectively caps the number of Scottish students who can go to St Andrews, where Prince William studied.

"The prevailing policy both to limit funded numbers for Scottish students and to prioritise admission of Scottish students with potentially lower tariffs is inevitably to the disadvantage of those Scottish applicants with higher tariffs who wish to study at St Andrews," the document states.

"Due to the unexpectedly high number of Scottish entrants in 2014/15, it is anticipated that the total number of Scottish-domiciled entrants will be significantly lower in 2015/16."

Last night, St Andrews came under fire from student body NUS Scotland who argued the time for "political posturing" was over.

Gordon Maloney, president of NUS Scotland, said: "Most universities have now accepted prior attainment is an outdated way to judge future potential except, it seems, St Andrews.

"Far from lowering standards or dumbing down, fair access can help improve standards by getting people with the most potential into our university places.

"We need to get on with improving the opportunities and outcomes available to those from our most disadvantaged communities."

Mary Senior, Scottish official for the UCU union, which represents lecturers and support staff, accepted the university had made progress on access.

But she added: "It is right we have a policy to reach students from poorer and hard to reach backgrounds and the comparisons St Andrews makes between those with different tariff scores is not comparing like with like.

"It can be a significant achievement for students from lower socio-economic backgrounds to achieve the level of qualifications enabling them to access university and it is exactly these sort of students that we should be encouraging. I can't see any evidence here that other students are being disadvantaged."

A spokesman for St Andrews University said the institution - which has the highest proportion of students from private schools in Scotland at some 40 per cent - fully supported the Government's widening access drive, but that there was an inevitable consequence.

He said: "As Government policy dictates that more of these places should be reserved for students from one demographic, it is a simple fact that in a finite system there will be fewer places available to applicants not in that category."

Professor Louise Richardson, the principal of St Andrews, questioned the policy last year stating: "I understand the need for access, but we don't need the government to tell us. I don't think bureaucrats should be setting targets."

Currently, the middle classes dominate higher education and access initiatives have only gone a small way to redress the balance.

Critics of the current system argue it seriously disadvantages bright pupils from poorer backgrounds because they have little or no family experience of higher education, will not have been given private tutoring and may not be able to access Advanced Highers. In contrast, many of those from middle class areas or who go to private school have spent years preparing for university.

The university's concern comes after the Scottish Government made it a priority for universities to improve rates of participation by pupils from deprived backgrounds after a decade and more of stagnation.

All institutions have been tasked with improving access under new outcome agreements with the Scottish Funding Council, with those that fail facing a clawback in funds.

In 2013, the Government announced £3.5 million to pay for more than 700 extra places to kick-start the initiative, but universities are concerned these numbers will not be funded in future.