Tens of thousands of school pupils are to have their exam results upgraded after the Scottish government agreed to accept teacher estimates of scores.
The government U-turn follows an outcry from pupils after a moderation system saw 125,000 estimated results being downgraded.
All results that were downgraded will now be withdrawn and replaced by the original estimates.
The move affects about 75,000 pupils across Scotland.
There had been claims that the moderation system unfairly penalised pupils at schools which had historically not performed as well.
And many pupils said they had been given lower grades than they had achieved in prelim exams at the start of the year.
Education Secretary John Swinney said he was sorry for the "feeling of unfairness" caused by the downgrading, adding that it was "deeply regrettable we got this wrong".
Mr Swinney and First Minister Nicola Sturgeon had both previously argued that basing grades on teacher estimates alone would damage the credibility of this year's results compared to previous years.
Opposition parties in the Scottish Parliament are pushing for a vote of no confidence in Mr Swinney, with Labour and the Conservatives calling for him to quit.
The coronavirus lockdown saw all of Scotland's school exams cancelled for the first time ever, with the Scottish Qualifications Authority (SQA) drawing up a new system to calculate results.
This was to be based on teacher estimates for each of their individual pupils, based on their work during the school year.
But these estimates were then fed through an SQA moderation system, which downgraded the marks handed out by teachers to bring them closer in line with previous years.
This sparked an outcry from students, particularly when it emerged that the Higher pass rate for pupils from the most deprived backgrounds was reduced by 15.2 percentage points, but only by 6.9 percentage points for the wealthiest pupils.
Mr Swinney accepted there was "clear anger and frustration from young people and their families" about this, saying it had "left many young people feeling their future had been determined by statistical modelling rather than their own ability".
He said he would now direct the SQA to reissue grades "based solely on teacher or lecturer judgement".
Fresh certificates will be issued and the university admissions body informed of the changes so applications can be processed.
A review of what has gone wrong will also be held, as well as a longer-term study of how future qualifications should balance exams and teacher assessments.
First Minister Nicola Sturgeon had previously said that accepting teacher estimates without moderation would lead to an exceptionally high pass rate compared to previous years, which she said would not be "credible".
And Mr Swinney said last week that he believed teachers were often "optimistic and aspirational" about their pupils' abilities, while an exam system "does something different".
This year's Higher pass rate will now sit at 89.2%, up 14.4 percentage points on 2019, while the Advanced Higher pass rate is at 93.1%, up 13.7 points from the previous year.
At Ms Sturgeon's coronavirus briefing on Tuesday, she said she now believed concerns about the credibility of the unusually high pass rate were outweighed by the risk of students thinking the system was "stacked against them".
'My medical dream is alive again'
A Motherwell pupil whose dream of becoming a doctor appeared to have been shattered by downgraded Higher results will now get the five As that she needed.
Olivia Biggart believed she was downgraded to two As and three Bs because her school is in a deprived area.
The 16-year-old said she cheered at John Swinney's announcement that she would now get her original estimated grades.
She will now be able to apply for medical school in October.
"I am over the moon because finally there is justice and I can pursue my career," she said.
"I am happy with what he said - and glad he apologised to us."
Labour are pushing for a vote of no confidence in Mr Swinney, likely to be held at Holyrood later in the week.
The party's education spokesman Iain Gray said Mr Swinney had left students "twisting in the wind for a week", and urged him to "take full responsibility for it happening in the first place and resign".
Scottish Conservative MSP Jamie Greene said Mr Swinney's statement had been "the longest resignation speech in history, minus the resignation", and Lib Dem leader Willie Rennie said the education secretary was "part of the problem, not the solution".
The Scottish Greens said Mr Swinney had "refused to listen" to earlier concerns, but welcomed that he had met the conditions the party had set for backing him in any confidence vote - likely securing his future.
This decision in Scotland puts the cat among the pigeons for exam results for the rest of the UK - where A-level results are due on Thursday.
If Scotland's students are given higher grades based on teachers' predictions, how will it be fair if they're competing for the same university places as students from England, Wales and Northern Ireland?
Will the newly-boosted grades of Scottish students bump others out of university places, whose results have been pushed down by the moderation process?
And if pegging pupils' results to the previous achievement of their school is unfair in Scotland, how will it be fair for those getting A-levels in England, Wales and Northern Ireland.
These grades are for life, important for jobs as well as higher education. And it raises the question which is more important, fairness for the individual, or the smooth running of the exam system?
Scotland's change of heart will pile on the pressure for changes in the rest of the UK - but like turning an ethical Rubik cube - any change will generate other patterns of unfairness.
In England using teachers' predictions would have meant almost 40% getting an A* or A at A-level this year - and below that average there will be some teachers who have been very tough and others very generous. That would risk creating even more inequalities that could fill court rooms for years.
Until now England's Department for Education has rejected any change of plan, but the stakes have been raised.
How has the moderation system affected your exam grades? Share your experiences by emailing firstname.lastname@example.org.
Please include a contact number if you are willing to speak to a BBC journalist.