PUPILS in Scottish primary schools are in larger classes than when the SNP came to power in 2007.

The Scottish Government was accused of an "abject failure" after figures showed average primary school class sizes have reached a seven-year high - 23.2 now compared to 22.8 in 2007.

And the number of pupils in class sizes of 18 or fewer in the first three years of primary has also fallen to its lowest level since 2007, despite a key election pledge.

Overall, the official statistics revealed a fall in the number of teachers and an increase in the number of pupils in Scottish schools.

Scottish Labour education spokeswoman Kezia Dugdale accused the Government of an "embarrassing failure".

She said: "These statistics show teacher numbers continue to drop and many of our primary classes are getting larger. Parents, teachers and our children deserve better than this."

Liberal Democrat education spokesman Liam McArthur said it was "particularly frustrating" the pupil-teacher ratio in primary schools was at its highest for seven years.

"The numbers the SNP ­promised us would go up are going down, and the numbers they said would go down are going up," he said. "On class sizes, teachers and pupil-teacher ratios, these figures are a list of SNP broken promises to children in Scotland."

Liz Smith, the Conservative education spokeswoman, added: "The Scottish Government has made a series of pledges over the years on class sizes, and they have continually failed to implement them."

Teaching unions also raised concerns, with Larry Flanagan, general secretary of the Educational Institute of Scotland, attacking the decline in teaching numbers.

However, Education Secretary Michael Russell said he was "particularly pleased" the figures for 2013 showed the pupil-teacher ratio for primary and secondary schools combined remained at 13.5 - the same as 2012.

He said: "The Scottish ­Government took steps to manage the supply of teachers and now we have the lowest level of teacher unemployment across the UK."

He also highlighted figures that show nearly all pupils in the first year of primary are in class sizes of 25 or fewer in line with legislation.

The SNP also suggested the biggest decreases in teacher numbers were in Labour-run council areas.

Douglas Chapman, education spokesman for council umbrella body Cosla, said local government had delivered on its commitment to maintain teacher numbers in line with pupil numbers.

He said: "At a time where the public sector remains under huge financial pressure this a significant achievement by Scotland's councils."

"The statistics are positive and, like in previous years, local government has been true to its word on teacher employment."

There were 51,078 teachers working in Scotland in 2013 - down slightly from 51,253 the previous year and down by justmore than 4000 from 2007, when the total was 55,100.

Meanwhile, there are now 673,530 pupils in pre-school, primary, secondary and special schools across Scotland, an increase from last year's total of 671,218, but almost 19,000 lower than in 2007.

In the run-up to the 2007 ­Holyrood elections, the SNP pledged to cut classes for P1 to P3 pupil to 18 or fewer, but in 2009 an agreement with Cosla set a target of 20% for this. The Scottish Government also has an agreement with councils to maintain pupil teacher ratios at their existing level.

The figures also showed the number of pupils excluded from schools is less than half the total it was in 2006-07.

And some 84% of pupils are now being taught in buildings in good or satisfactory condition, compared to 61% in 2007.