AP

THE outcome of Sweden's cliffhanger election was in doubt until late on Sunday September 17th. But the opposition centre-right alliance under Fredrik Reinfeldt, leader of the Moderate Party, eventually emerged with a small but clear victory. The four parties in the alliance took an overall vote of 48.1%, compared with 46.2% for the ruling Social Democrats and their allies. After the tiny parties that failed to cross the 4% threshold are eliminated, that will give the centre-right a seven-seat majority in the Riksdag, Sweden's parliament.

Given that the Social Democrats have been in power for all of the past 12 years (and for 65 out of the past 74), this result is something of a revolution. But it is a revolution Swedish-style. A handful of youngsters jumped into the fountain on Sergels Square in Stockholm, yet there was no wild partying or dancing in the streets. And although Mr Reinfeldt has promised a few tax cuts and some trimming of welfare benefits, his platform was not a radical one. He will keep the famous Swedish model, but tinker a little at the edges.

Why did the Social Democrats lose? The Swedish economy has recently been the envy of Europe, with good growth, strong exports, a bouncy high-tech sector and relatively low unemployment. In the second quarter of this year, GDP growth hit a racy 5.6% at an annual rate. And all this has been combined with a high level of social protection and a generous welfare state.

But at home there has been mounting dissatisfaction. Many voters were simply fed up with the prime minister, Goran Persson, who has been in office for ten years. A series of minor scandals has tarnished the Social Democrats' reputation for integrity and incorruptibility. And for all the praise heaped on the country's welfare system, disguised unemployment in Sweden remains high. Youth unemployment, for example, is among the worst in Europe. The election result suggests that all is not well with the Swedish model.

It also helped that voters found Mr Reinfeldt to be charming, reasonable and, not least, young (he is 41). His party lost badly in 2002, and he drew the conclusion that it should shift to the centre, jettisoning fierce talk of slashing taxes and dismantling the welfare state. In a conscious imitation of Tony Blair in the 1990s, he even rechristened the party the New Moderates, and has promised to rule as such. He worked hard to keep his alliance united and disciplined, even through a spying scandal that hit the Liberals last week. On election night, he told party workers that “it was teamwork that won this election.”

The new government is likely to be cautiously liberalising. Besides some modest tax and benefit cuts, it will sell some of the state's extensive shareholdings and seek to inject more choice and competition into Sweden's large public sector. It may try to deregulate the labour market a little, even if it is unlikely to challenge the country's powerful trade unions overtly. Foreign policy will change little. Mr Reinfeldt wants to join NATO, but others in his coalition do not; he has no plans for a fresh referendum on joining the euro; nor will he cut Sweden's generous foreign-aid budget.

The political fall-out from this election could be lasting, even so. Mr Persson, who is to step down as leader next March, bravely declared that the Social Democrats had not been slaughtered, and yet this was the party's worst electoral performance since 1914. Nor does he have an obvious successor as leader. The Moderate Party had its best result since 1928. Mr Reinfeldt and his alliance are already talking of winning a second term. Along with other opposition parties in Europe, the British Conservatives under their new young leader, David Cameron (he is only 39), will be taking careful note.