Small rise in primary one to three class sizes
Class sizes in the first three years of primary school have seen a slight year-on-year rise, according to the latest official statistics.
The average class size for pupils in the first three years of primary rose from 22.5 in 2011 to 22.6 in 2012.
Scottish government figures also said that the proportion of primary one to three pupils in classes capped at 18 pupils fell by 1.4% to 18.8% in 2012.
Just over 500 primary one pupils were in classes of more than 25 students.
In 2011, the Scottish government introduced a legal limit of 25 pupils for primary one classes, citing the change as "an important stepping stone" towards its target of class sizes of 18 or fewer for all pupils in the first three years of primary school.
Until the start of the 2011-12 school year, each teacher could have up to 30 pupils in their class.
The latest figures from Scotland's chief statistician revealed that in 2012, 99.1% of P1 pupils were now in classes of 25 or fewer.
Education Secretary Mike Russell said legislation had helped wipe out large primary one classes.
The government's figures also revealed a rise in the number of probationer teachers in permanent or temporary employment.
Three-quarters of teachers on the 2011-12 probation scheme had found work in state schools by September, up from 66% the previous year.
The total number of teachers based in pre-school, primary, secondary and special schools, or visiting specialists, was 51,410. This is 21 fewer than the 2011 figure of 51,431.
Labour's education spokesman, Hugh Henry, said the figures showed "the shocking reality" of the SNP's broken promise on teacher numbers.
"Alex Salmond came to power in 2007 promising to maintain teacher numbers at 54,136," he said.
"He quickly ditched this and is now trying to blame local councils for the reduction of 3,902. It was his promise and he has conned both teachers and parents. No wonder so many newly qualified teachers are finding it hard to get a job."
He said the government had also broken its promise to reduce class sizes in P1-P3.
"And it's even worse in secondary school," Mr Henry added.
"SNP ministers have allowed an increase in class sizes in English and Maths in S1 and S2 - vital transitional years for school pupils."
Liz Smith, the Conservatives' education speaker, said: "The SNP came in with a bold promise to reduce class sizes in all P1 to P3 year groups, yet these figures show they are moving in the opposite direction.
"Every time the Scottish government has been asked to explain the class size situation, it will only say very good progress is being made. It needs to explain why its key election pledges are so far removed from the reality of our classrooms."
The Liberal Democrats' Liam McArthur said the figures read like a "list of broken promises".
"In five years the SNP has failed to deliver its pledge to reduce average class sizes for P1-3 pupils to 18, with the average class size returning to 2007 levels at 22.6 pupils.
"Parents don't want grandiose pledges; they want a fair commitment to their child's education."
However, the general secretary of the EIS teaching union gave the latest news on teacher numbers a "cautious welcome".
Larry Flanagan said: "In 2011, as part of a package of changes to secure employment for teachers, the EIS agreed through the Scottish Negotiating Committee for Teachers the minimum number of teachers in Scotland should be at least 51,131. This figure was met in 2011 and has been met again in 2012.
"While there is a slight upward trend in pupil numbers the commitment to maintain teacher numbers has been met. We welcome the Scottish government's ongoing commitment to teacher employment.
"The EIS is concerned, however, that 12% of teachers are on temporary contracts. The lack of security in employment is a factor in driving teachers to find secure employment elsewhere."
On class sizes, Mr Flanagan said: "The EIS also notes the slight increase in class sizes identified in the statistics. While the overall increase is fairly small, this remains an issue of real concern."
'Halted the decline'
The National Statistics report also said 403 school buildings had been substantially rebuilt or refurbished in the last five financial years.
The proportion of schools reported as being in a good or satisfactory condition increased during that period, from 61% in 2007 to 82% this year.
The proportion of pupils educated in schools which are in a poor or bad state fell by more than half over the same period, from 37% of pupils in 2007 to 16% in 2012.
Education minister Mike Russell said: "Despite pupil numbers increasing, we have almost wiped out P1 classes of more than 25 - the number of P1 children in these classes has fallen by 97% since 2006 and we have made clear progress since introducing legislation.
"We are providing stability in our classrooms and have halted the decline in teacher numbers evident since 2007.
"Small class sizes are a vital part of our commitment to the early years, so where pupil numbers are rising I anticipate that councils will increase teacher numbers in future."