The Swedish education system has long been an attractive model for other countries - high performing, genuinely equitable, with only a small variation in performance between schools. Its successful comprehensive school system has been widely copied in Europe, though with varied success.
But Sweden is no longer top of the class. The performance of its 15-year- olds has slipped steadily in international comparisons, its measures of social mobility and equity have declined, and it now lags behind other Nordic countries, having led them for decades. It is still doing better than England. But as immigration reaches record levels, and its population becomes less homogeneous, the slide could continue.
"What we observe is a decline, especially in science and mathematics, and especially from 1995. It has been quite a steep decline, by as much as one grade, so that students in Grade 8 (age 13 to 14) in 1995 performed at the level of Grade 9 students now," says Jan-Eric Gustafsson, professor of education at Gothenburg University and an adviser to the Swedish National Agency for Education.
"There is increasing variation between schools. We have widened the difference between students with educated parents and those whose parents are not so highly educated, and girls who were ahead of boys in the 1990s are now even further ahead.
"Meanwhile, the parental population has an increased level of education and you would expect that to cause an increase in children's level of performance, so societal changes appear to be working in the other direction."
In short, the results show that Swedish schools have become less effective in compensating for socio-economic differences. Professor Gustafsson's findings have fed into a recent systemic government review, called "What Influences Educational Achievement in Schools?"
"In the past Sweden showed it can moderate inequalities in society better than other countries through its education," says Andreas Schleicher, head of education indicators at the Organisation for Economic Co-operation and Development (OECD) in Paris. "Although Sweden is still above the OECD average on equity, the slide, though not dramatic, is noteworthy," he says.
Perhaps more astonishing than the decline itself is that it took so long for the government to notice, investigate and act. At first politicians blamed Sweden's economic crisis of the mid-1990s when education spending was cut. But Finland, which went through a similar crisis at the same time, has the world's top performing education system. Extensive studies into the reasons behind Sweden's decline from the mid-1990s on are only now being carried out, but explanations are still tentative.
What is emerging is that major changes such as housing segregation have led to increased divisions in schools by socio-economic group, as has decentralisation of responsibility for schools to local communities. More individualised teaching, the quality of teachers and the increase in independent schools may have all contributed.
There is a sense that no more time can be wasted. A number of major reforms are in the pipeline to push up standards, to improve teacher training and to introduce a more rigorous testing regime. But this may not halt the decline in education equity, with long-term implications for Swedish society.
"Delivering equity is very difficult and it is very easy to increase disparities if you do nothing," Mr Schleicher says.
In the 1990s, as part of a major reform, education budgets were decentralised to the municipalities, while new for-profit schools were allowed to open.
"We had decentralisation in the system and free choice, with the new (independent) schools. But it is mostly students from families with high educational backgrounds that used these opportunities, and that has led to an increase in segregation between schools," says Per Thullberg, director general of the Swedish Education Agency.
With some 635 independent primaries and 360 independent high schools, more than 10 per cent of Swedish pupils now attend such institutions until they reach 16, rising to 20 per cent in upper secondary (16-18). In larger urban areas such as Stockholm, half of all pupils attend independent schools.
Much has been said and written about the introduction of independent schools in Sweden. In England it has become a political hot potato, with the Conservative party seeking to copy elements of the system. But the jury is still out on the schools' wider effect.
Mikael Lindahl, associate professor of economics at Uppsala University, has compared parts of Sweden with large numbers of independent schools to areas without. "I don't think the introduction of these schools is the reason why Swedish pupils have done worse," he says. "There is very little impact. Independent schools are not allowed to cream-skim to take the best pupils. It used to be difficult for immigrants (who are mainly in the suburbs) to move to a good area. But now they don't have to, they can go to one of the new schools.
"It is safe to say no one lost out from these reforms. But they did not gain a lot either," Dr Lindahl concludes.
Sweden's main political parties do not blame for-profit schools for the decline in performance nationally, in part because they remain popular with parents. But the new schools have not helped break the decline in performance either.
"We have had increasing segregation and decreasing results, so we can't say that increasing competition between schools has led to better results," says Mr Thullberg.
There is much greater criticism of the decision in the 1990s to devolve responsibility for schools to the municipalities. The belief was that local communities knew their schools and needs and were better placed to distribute available resources. That assumption appears to have been incorrect.
"The truth is that municipalities distribute funds on an equal basis, basically on a head count," says Professor Gustafsson. "Extra resources are very hard to come by. We have seen effects on performance of younger children, on those with less educated parents and on those who do not know Swedish. But they (municipalities) don't compensate for this."
In addition there has been very little oversight of local authorities.
"There are 290 municipalities, so there are 290 different school systems in a country of just nine million people. We have been very critical about that," says Metta Fjelkner, president of the Swedish Teachers' Union.
The union has ranked the different municipalities according to criteria such as spending per student, student-teacher ratios and performance in Grade 9.
Some of Sweden's best primary and lower secondary schools were in municipalities along the sparsely-populated south eastern coast. The worst were in Sodertalje, 30km south of Stockholm, where nearly one in 10 residents are refugees from Iraq who arrived after 2003.
The union argues that the huge disparities between municipalities at the top of the rankings, which spend around Kr66,500 (pound;6,000) per pupil and those at the bottom, which spend just Kr32,300 (pound;2,800) per pupil, show that local authorities are not following the country's school law, which stipulates that all children should have access to a comparable education.
The OECD's Mr Schleicher believes "things may have gone too far" in localising control.
Even if parents noticed, their reaction in the past was muted, believing they could simply opt for a better performing school. That illusion of choice may have masked systemic decline.
Hakan Mossberg, president of the Parents' Alliance, says there is a general lack of information for parents, with no school marks provided until the end of Grade 8. "Parents feel they have been fooled a little by the system because results come too late to do anything about it."
Although the government is now bringing in testing from Grade 5, he believes it should have acted much earlier.
Now stronger guidelines are being published on subject content and concrete goals are replacing the abstract grading criteria of the past. Independent schools will also have to teach according to the guidelines. Proposals about to make their way through parliament include a new school leaving examination for 18- to 19-year-olds and earlier testing.
It could signal the end of Sweden's characteristic free-and-easy system for both pupils and teachers. School inspections have begun, and teacher training and quality of teaching is being targeted.
One of the striking findings of the government's review of performance was the effect of individualised teaching. "Individualisation is misunderstood: it should be that you stress the individual and help the individual but you don't leave all the students alone working for themselves. You must think it strange, but in Sweden a lot of work is done by the pupils sitting alone with their books, doing their exercises in mathematics, but the teachers are not active in explaining the problems," Mr Thullberg says.
Professor Gustafsson believes this goes a long way in explaining why pupils whose parents are from less educated backgrounds suffer most.
The government's response has been to overhaul teacher recruitment, drawing up proposals for testing and licensing teachers and for providing more continuous professional development. Teaching is not a popular career choice and politicians remark that most teachers are of a low calibre.
The union has been pushing for improved teacher training for many years and backs the changes. But it wants politicians to go further, including, more radically, to take back control.
There is no national school leaving exam in Sweden, but each year some 11 per cent of 15- and 16-year-olds fail to reach the goals set. "Yet the government won't fix failing schools. No one takes responsibility," says Ms Fjelkner, who says the union has been warning about the problems for more than 10 years.
"The reforms will partially correct the problems," she adds. "But they are far too late, and the students who did not receive the education they are entitled to will pay the price."
Where tough discipline means calling the teacher `Mrs'
Ben Kersley spends a day at the International English School (IES) - one of Sweden's famous "free schools" - in Linkoping
"Who can tell me what a smart Alec is?"
Finally, a question that has stumped all the pupils in the classroom. Either that, or they had realised that only a smart Alec would be stupid enough to answer.
At the IES in Linkoping, central Sweden, Natasha Smith is holding an English class for her Year 9 pupils. It's hard to define the class as English language or English as a second language because the level of fluency is so impressive among the 15-year-olds. About half of all lessons at the school are held in English, meaning that when it comes to the actual English class, it's no surprise that they are tackling novels, films and idioms such as "smart Alec".
The IES is an independent school that draws its pupils from all over the county. The students here (or at least their parents) have actively chosen to come to this school. Contrary to the assumption that independent schools lead to covert selection and social division, the IES in Linkoping has pupils from across the socio-economic spectrum.
Admissions are based on a waiting list system, rather than geography, and roughly 5 per cent of pupils commute from outside the catchment area of Linkoping's education authority. It is the policy in Sweden that money should not be a divisive issue in education and these pupils' fees are covered by their own local education authority.
Since the school started in 2003, its reputation has grown. It is known locally not only for the fact that tuition is in English, but also that the school has a reputation for discipline. This is something of a novelty in Sweden, although all things are relative: discipline at the IES means standing up quietly at the beginning and end of a class, putting your hand up to answer a question and addressing the teacher as "Mr" or "Mrs". All of which is seen as radical in Sweden when in most schools teachers are known by their first names.
Mrs Smith, as she is known to her pupils, acknowledges that there is no need for greater levels of discipline as there just isn't the same amount of pupil disruption that she encountered when teaching in the UK.
Teaching in Sweden is still a high pressure job, but it is a different kind of pressure. There are fewer governmental demands in terms of achieving national standards, but without this, pupils are sometimes not pushed as hard to achieve their full potential. There are fewer external tests and homework is not meant to infringe on home life.
In small groups, Mrs Smith's pupils have been discussing the narrator's character in a short story about ice cream and when the class is asked a question, hands shoot up enthusiastically to respond. When the 40-minute lesson comes to an end, the pupils file out of the classroom with the usual banter of 15-year-olds, some slipping back to their native Swedish and some smart Alecs continuing in English.