Speaking at First Minister’s Questions, the SNP leader was challenged on figures which showed no students from more affluent areas or average and good schools in Scotland were accepted onto Edinburgh University’s law course last year.
Eight other courses, including business, history of art, and Japanese, also saw no non-widening access students accepted by Edinburgh University.
However, foreign students who have to pay around £25,000 a year to study at the university and students from the rest of the UK were accepted on the courses.
Michael Marra, Scottish Labour’s education spokesperson, criticised the Government’s approach to higher education funding and said a “historic promise of a Scottish education” had been broken.
He said: “For 440 years, the University of Edinburgh has admitted among the best and brightest of Scotland; Walter Scott, Katherine Grainger, Stewart McDonald, Robert Louis Stevenson, Joanna Cherry, all great minds who worked hard and gained entry to study law here in our capital city.
"With funding frozen for 13 years and the SNP’s cap on Scottish students, the historic promise of a Scottish education is broken. After five centuries, First Minister, how has it come to this?”
Ms Sturgeon said she was “gobsmacked” by the question and the fact it came from a Labour MSP. She stressed the figures were a “good thing”.
The First Minister told MSPs: “I'm actually quite gobsmacked that that question has been put in that way by a Labour member of Parliament.
"A record number of young people secured places at university in this latest UCAS cycle, a record number of 18-year-old Scots have secured a university place, up 20 per cent since 2019 the last year there were exams.
"The data, yes, provides a really, really positive story for those applying from deprived areas – 18-year-olds securing places from the most deprived areas have increased by 31 per cent since the 2019 cycle and all age acceptances from the most deprived areas are up by 4 per cent."
She added: “I, and this is where I take issue with Michael Marra, in my earlier days as First Minister, I used to be regularly criticised for the fact that there were too few people from deprived communities going to university. Now I appear to be being criticised for the fact that there are too many going to university.
"I don’t come from a deprived background, I come from a working-class background, I went to state school. When I studied law at Glasgow University, I was very much in the minority.
"I think it is really good news, within a context of a record number of young Scots at university, that we’re seeing more from the most deprived areas actually going to our universities.”