Media playback is unsupported on your device Media caption Minister John Swinney has outlined the areas where Scotland's education system needs to improve.

The literacy skills of Scottish school pupils have fallen over the past four years, according to figures published by the Scottish government.

The Scottish Survey of Literacy and Numeracy found that less than half of Scotland's 13 and 14-year-olds are now performing well in writing.

P4 and P7 pupils also saw a drop in writing performance.

The reading ability of P4, P7 and S2 pupils remains broadly similar to 2014 - but lower than 2012.

And there has been no reduction in the big gap between the performance of the country's wealthiest and most deprived pupils.

Scottish Education Secretary John Swinney acknowledged that the figures were "simply not good enough" and showed that education reforms were now "imperative".

Mr Swinney added: "If anyone looking at these literacy results thinks nothing more needs to change in Scottish education, then they are mistaken."

He later made a statement to the Scottish Parliament, where he told MSPs that the drop in writing performance for S2 pupils was of particular concern

The Scottish Conservatives described the results as "shameful" and said the SNP had "failed a generation" during its decade in government.

But the EIS teaching union said the figures showed that Scottish pupils were continuing to perform well "despite the many challenges that our schools have faced in recent years".

Image copyright SSLN

The Scottish Survey of Literacy and Numeracy (SSLN) is an annual sample survey which monitors national performance of school children at P4, P7 and S2 in literacy and numeracy in alternate years.

The 2016 survey, the results of which were published on Tuesday morning, focused on literacy and involved about 10,000 pupils in 2,250 schools.

It found that in writing:

49% of S2 pupils performed very well or well in writing last year, compared with 55% in 2014 and 64% in 2012.

There has been a seven point drop in P7 pupils who can write well or very well, from 72% to 65%, since 2012

The writing performance of P4 pupils is now two points lower than in 2014 and 2012, at 62%

While in reading:

Performance of P4 and P7 pupils was high

But the number performing well or very well in P4 dropped from 83% to 77% between 2012 and 2016

P7 and S2 performance in reading in 2016 is also two points lower than in 2012, at 88% and 82% respectively

S2 performance in reading was two points higher than the 80% recorded in 2014

Pupils from the least deprived areas outperformed pupils from the most deprived in every category, and across all three age stages.

The size of the attainment gap was similar to the one recorded in 2012 - standing at 18 points in P4, 13 points in P7 and 16 points in S2 for reading.

And for writing, the size of the gap was 15 percentage points in P4, 20 in P7 and 18 in S2.

Image copyright Getty Images Image caption S2 pupils were more likely to read using an electronic device than a book

About a quarter of P4 pupils said that they seldom or never read together with someone at home, while just over a fifth said they did not play number or counting games.

And 29% said they never or rarely played word games.

Meanwhile, 40% of S2 pupils said they read "very often" using an electronic device such as mobile phone, tablet or e-reader, but only 22% said they regularly read fiction books and 14% said they frequently read non-fiction books.

Last year, the SSLN's numeracy statistics showed that pupils in Scotland were also doing less well in maths.

And Scottish schools recorded their worst ever performance in the international Pisa survey of pupils, with standards in maths, reading and science all falling.

It was the first time since the Pisa tests began in 2000 that all three subject areas were classed as "average", with none "above average", when compared with other countries across the world.

Image copyright Thinkstock Image caption The survey monitored the performance of thousands of pupils across P4, P7 and S2

Speaking ahead of a visit to a primary school in Edinburgh, Mr Swinney said there were four key areas where improvement was needed.

He said: "We need to better understand the progress of individual pupils, be clear about the standards expected in our classrooms while stripping out bureaucracy to free teachers to teach, and ensure literacy skills are fully embedded across the curriculum."

Mr Swinney insisted that the Scottish government was taking action to provide teachers and schools with the tools and resources to improve literacy.

Its reforms include a £120m annual fund aimed at closing the attainment gap, as well as standardised testing and new regional education boards.

But he said: "These reforms are not an overnight solution; it will take time before we see their full effect and we must stay the course.

"But if anyone looking at these literacy results thinks nothing more needs to change in Scottish education then they are mistaken. Further reform is now imperative".

Analysis by Jamie McIvor, BBC Scotland education correspondent

There's little cause for cheer in the literacy figures.

The survey suggests no improvement in reading or writing since 2012 - although there are some signs of progress in listening skills.

Worse there have been significant declines in writing performance since 2012.

In the case of youngsters in their second year of secondary school, the decline has been stark. A minority can now write well, very well or indeed exceed expectations for their age.

For the Scottish government, which says it wants to be judged on education, this is an enormous headache.

First Minister Nicola Sturgeon has previously said she wants to be judged on her education record, which she has described as her top priority.

But opposition parties have accused her of neglecting education while pushing for a second referendum on independence.

Scottish Conservative education spokeswoman Liz Smith said reading and writing ability had fallen to "shameful" levels under the SNP.

She added: "Given this evidence, it is abundantly clear that the Scottish government is not doing enough to address the problems in basic literacy that this data highlights.

"It also shows that a very persistent gap between pupils from the most deprived areas and the least deprived areas continues, and that needs to be tackled."

Scottish Labour's Iain Gray said: "No child should have their life chances determined by their background - yet that is exactly what is happening under a Nationalist government obsessed with the constitution."

Ross Greer of the Scottish Greens called for investment to reverse cuts to teachers, additional support needs staff and librarians in the country's schools.

And Scottish Liberal Democrat leader Willie Rennie said the SNP's "obsession" with independence was "taking a terrible toll" on education.

EIS general secretary Larry Flanagan said: "At a time when education budgets have been falling, staff numbers have declined and teachers and pupils have been under severe workload pressures, our schools have continued to perform well.

"If the attainment gap is to be tackled successfully, we need to see an end to the politics of austerity and a renewed political commitment to support our comprehensive system, including tackling the excessive workload which still blights our schools."

What % of pupils reach the level? Competency Early (P1) First (P4) Second (P7) Third (S3) Fourth (S3) Reading 81% 75% 72% 86% 39% Writing 78% 69% 65% 84% 37% Listening 85% 81% 77% 87% 41% Numeracy 84% 73% 68% 86% 49%