Thousands of students awarded lower than expected grades in this summer's GCSE English exams were the victims of "illegitimate grade manipulation" and "a statistical fix", the High Court has been told.

The accusation came from a QC representing an alliance of hundreds of pupils and schools and scores of local councils, as well as teaching unions, in an unprecedented legal action.

The alliance is challenging a move by the AQA and Edexcel exam boards to raise the boundary needed to get a grade C between January and June, as well as the actions of England's exams regulator Ofqual.

The alliance claims that legally flawed decision-making led to an estimated 10,000 pupils who sat exams in June missing out on a C grade, and is asking for papers taken this summer to be regraded.

Clive Sheldon QC, appearing for the alliance, told two judges it was not the fault of students, who had "worked well and hard", that they had received the lower grades.

He said the evidence of unfairness was overwhelming. Students were the victims of a radical change in grade boundaries that occurred without warning.

Mr Sheldon said Ofqual had given an instruction to avoid "grade inflation", and bodies awarding grades were required to meet tolerances set by Ofqual based on statistical predictions derived from students' performances in Key Stage 2 examinations five years previously.

Schools, teachers and students had reasonably expected that those sitting the June examinations would be treated consistently with students who had earlier taken papers and submitted controlled assessments, argued Mr Sheldon.

The boards and Ofqual knew at the time of the publication of the January marks that this reasonable expectation might be disturbed but did nothing to alert schools, teachers and students that radical changes might occur in the summer, he said.

Mr Sheldon told Lord Justice Elias and Mrs Justice Sharp, sitting in London, there could be no doubt that there was "grade manipulation" by the examination boards to meet Ofqual's "statistical fix" and this amounted to an unlawful abuse of power.