Nicola Sturgeon has been urged to make a "divine intervention" after pupils were said to have been left in tears after an "unfair" Higher maths exam.

Kezia Dugdale, the Scottish Labour deputy leader, called on the First Minister to act and also demanded the SNP leader "fix the unfair and unjust" exam appeals system.

She pressed Ms Sturgeon on the issue after more than 13,000 people signed two online petitions urging the Scottish Qualifications Authority (SQA) to take the difficulty level of the maths exam into account when marking.

Ms Dugdale recalled that the First Minister had written an article on the importance of Scotland's education system for a newspaper just days ago, in which she described education as a "sacred responsibility".

The Labour MSP said: "The appeals system and the new exams need sorted out.

"She said education is her sacred responsibility, it's time for some divine intervention from this First Minister."

But Ms Sturgeon accused Ms Dugdale of scaremongering.

As she was heckled by Labour MSPs during First Minister's Questions, the SNP leader said: "I don't think Labour members who are shouting abuse across the chamber right now are remotely interested in the fortunes of young people.

"As always the top priority of Labour members is simply to hurl abuse of the SNP: that will not be lost on anyone."

The First Minister insisted: "No young person sitting the higher maths exam will be disadvantaged if it is found out the exam is more difficult than was intended.

"How can we say that with confidence? Because the SQA has the process in place every single year to moderate results, to take account of the fact an exam might be found to be easier or harder than was intended."

Ms Dugdale had told Ms Sturgeon that schoolgirl Chloe Thomson, from Hawick in the Borders, said her "dream" of studying medicine at university "now seems completely out of reach due to the awful maths exam I endured".

Ms Sturgeon said: "I have huge sympathy for anybody who sits an exam and comes out of it feeling like that.

"Surely Kezia Dugdale's responsibility is to relay back to that young person the assurance and reassurances the SQA has given and I have outlined in this chamber.

"Let me repeat it - no young person sitting the higher maths exam will be disadvantaged if it is found out the exam is more difficult than was intended."

She added: "Instead of trying to play up those fears, surely Kezia Dugdale's responsibility is to join us in reassuring that young person."

But Ms Dugdale said Scottish Government ministers had pressed ahead with changes to the exam system despite the concerns of teachers, who had wanted the introduction of new Highers delayed.

"It is the concerns of teachers and parents I am bringing to this chamber," she told Ms Sturgeon.

The Labour MSP said the situation could affect the "future prospects of thousands of children across Scotland" as she raised concerns about the revamped appeal system, which brought in charges for appeals paid by schools

"In January I alerted the First Minister to the fact the the SQA appeals system is not fit for purpose," Ms Dugdale said.

"Access to it now depends on schools' ability to pay and appeals have been replaced by reviews and re-marks, which take no account of circumstances on exam day.

"Parents in private schools are paying for a second mark of their children's exams, they can even pay extra for a priority review for just £39.75 as advertised on the SQA website."

Ms Dugdale added: "The appeals system is about to be tested to destruction by this year's Higher maths exam, it's been four months since I last raised this, has the First Minister done anything to fix the unfair and unjust system?"

But Ms Sturgeon insisted: "The implication behind Kezia Dugdale's question that somehow better-off parents can buy better exam results for their children is simply not true."

She said the SQA had introduced the new system in 2014 "precisely so there was a fairer, more rigorous system in place".

"It is not fair to pupils around this country right now to come here with particular concerns, such as the concerns about the Higher maths paper which has been addressed and will be addressed by the Scottish Qualifications Authority, and somehow suggest our entire system is flawed.

"Why is that unfair? Because that undermines the efforts and is in danger of undermining the results of those students who have worked so hard to achieve exam passes."

Councils will meet the costs of requests by public sector schools, Ms Sturgeon said, as she said local authority education chiefs had "made clear in a statement back in February that no young person will be disadvantaged under the new system".

The SNP leader continued: "Those are the kind of assurances that are important for our young people and instead of trying to scaremonger, Labour should be doing their bit to get these assurances out there."

The First Minister told MSPs: "The picture Kezia Dugdale seeks to paint of our exams is an unfair one - it's an unfair one to pupils who studying so hard right now for those exams.

"Obviously we are aware of concerns that have been expressed about the recent higher mathematics exam and we take those concerns very seriously.

"The Scottish Qualifications Authority is responsible for ensuring that exams are set fairly and that they are set to the correct standards, it is also ensuring that rigorous processes are in place to ensure that candidates get fair treatment every year and standards are maintained.

"The SQA has assured us, and more importantly assured the people of Scotland, that no candidate will be disadvantaged if any exam paper is proven to be more demanding than it was intended to be.

"That's why those processes are in place, they're in place every year, and they're there to make sure our students who work so hard get the best treatment, because that is what they deserve."

The issue was also raised by Conservative MSP Liz Smith, who suggested that structure and style of some of the exam papers was not in line with what schools adopting the new Higher exams had used in prelims.

She said: "Can I ask the First Minister, given that half the schools actually opted to have the old Higher, if she thinks that that, combined with the concerns and the criticisms that we've had in this last week, reflects deeper concerns about the deployment of exemplar materials for the exam?"

Ms Sturgeon said: "I don't think it necessarily does that, although these will be issues that we want to study very carefully.

"The double running of the old and new Highers this year for one year only was as a result of careful discussion and consultation and agreement that that was the right thing to do.

"Liz Smith, I think rightly, acknowledges that there are processes in place to moderate results based on the difficulty or otherwise of exams compared to what they're intended to do, and of course if there are other issues raised after the experience of the exam diet this year the Education Secretary will raise those with SQA."