Nearly 30,000 Scottish pupils have received their exam results by text message a day early by mistake.
The Scottish Qualifications Authority (SQA) has revealed an urgent inquiry is under way after the mistake by external contractor AQL.
Pupils, who opted to receive their results by text on Thursday, were surprised to be told the news via mobile phone on Wednesday afternoon.
The results should have been texted to 29,863 pupils at 9am on Thursday.
Derek Douglas, spokesman for the SQA, said: "We are investigating reports and carrying out an investigation with the external contractor who issues the results on our behalf.
"Around 29,000 people opted to receive their results by text at 9am on Thursday and we believe 29,000 received a text today instead."
Social networking site Twitter has been inundated with messages from concerned pupils after the mistake.
Greg Lawson said: "If we were marking the SQA employees for their work, they'd get a big fat F. Ridiculous."
Rachel Paton said: "Bit ironic that the SQA (who mark our exams and put us down for our mistakes) have made a giant mistake by sending out all the results early." Mark Cunningham also tweeted: "I would not like to be the 'the external contractor' who sent out the 28k results texts a day early!"
But not everyone was unhappy. Liam Randall said: "I'm not complaining. Save being nervous tomorrow."
In 2010, pupils were able to receive their results via text a day early in a pilot scheme run by the SQA.
Almost 160,000 pupils in total are due to receive their exam results on Thursday.
Scottish Labour shadow education secretary Ken Macintosh said: "This is a serious mistake and will cause concern for the tens of thousands of people who have not had this headstart in getting their results.
"SQA has made serious mistakes with results in the past and they're meant to have tightened up their act.
"This should not have happened and pupils and parents need to know what has gone wrong quickly."
Scottish Liberal Democrat Leader Willie Rennie MSP said: "This is extremely unprofessional and will create a great deal of anxiety and stress for pupils already anxious and stressed.
"The person responsible should re-sit their IT exams."
Janet Brown, chief executive of SQA, apologised for the stress it may have caused and said an urgent inquiry is under way. She said: "This afternoon the 29,863 candidates who had opted to receive their SQA examination results via text message were sent these results early.
"The text results should have been issued to candidates at 09.00 tomorrow (Thursday August 4).
"SQA is conducting an urgent inquiry with the external contractor, AQL, which issues the texts on behalf of SQA, in order to understand how this has happened.
"All 159,744 candidates will continue to receive results in the traditional manner via postal delivery tomorrow.
"This is always a stressful time for candidates, their parents and their families and SQA apologises for any additional stress this may have caused. We do however want to reassure candidates and their parents that no candidate will have been given early advantage."
She added: "We have acted swiftly to ensure that candidates who have been sent texts will receive the same level of support as all of our candidates."
SQA has opened its candidate advice line early. From 3pm on Wednesday, call 0845 278 8080 to provide any support candidates may require. Skills Development Scotland has also opened its helpline early on 0800 100 8000.