The centre-left mayor of Slovenia's capital Ljubljana won a narrow victory in a parliamentary election on Sunday, making the outgoing Social Democrats the latest casualties of the euro zone economic crisis.

The defeat for Prime Minister Borut Pahor was expected, but the victory for mayor Zoran Jankovic marks an upset after weeks of opinion polls predicting a comfortable win for centre-right ex-prime minister Janez Jansa.

With 99.7 percent of votes counted, Jankovic's party was leading with 28.5 percent, or 28 seats in the 90-seat parliament. Jansa was on 26.3 percent and Pahor's party on 10.5 percent. Turnout was 63 percent.

Jankovic, who managed EU member Slovenia's largest food retailer Mercator before becoming mayor in 2006, will have to seek coalition partners, and Pahor said his party was ready to talk.

We are open for dialogue, the outgoing prime minister told Pop Television. We have to think of the future of this country.

Analysts predicted a coalition of Jankovic, Pahor's Social Democrats, the centrist Civil List of Gregor Virant and the pensioners party Desus.

Jankovic has previously ruled out a coalition with Jansa's Slovenian Democratic Party, which would have 26 seats in the new parliament.

I will not talk about coalitions now, Jankovic told Pop TV. We (in the party) will sit down to talk about it tomorrow and then start talks with other parties.

The coalition government faces a challenge in turning around Slovenia's economy, which is sliding into new recession and risks a further credit rating downgrade.

Economic woes in neighbouring Croatia, which will join the EU in mid-2013, also saw the ruling HDZ ousted in an election on Sunday.

RETURN TO RECESSION

The Alpine state of 2 million people was once a model of successful post-communist transition, but its export-driven economy has been hit hard by the global downturn.

After a modest recovery in 2010, data released this week suggest another recession is on the way after the economy shrank 0.5 percent in the third quarter of 2011.

Jankovic's party -- List of Zoran Jankovic, Positive Slovenia -- says it plans to boost budget revenues by raising value added taxs by 1 percentage point to 21 percent. It is against privatising state firms.

Analysts say the next prime minister will also have to hike the retirement age for Slovenians, which is among the lowest in the EU at 57 for women and 58 for men.

This is a surprise victory and shows that many voters decided at the last minute whom to vote for, Borut Hocevar, editor of daily Zurnal24, told Reuters.

Jankovic will focus on the economy ... and I also expect he will push through the pension reform as early as 2012.

Jansa, who was Slovenia's prime minister from 2004 to 2008, predicted the government would not last its 4-year mandate.

The result shows that it will be difficult to form a strong coalition and a strong government, and I fear another early election is likely, he told reporters.

Pahor's government lost its majority in May amid internal policy squabbles and was ousted by parliament in September.

My husband worked in construction and lost his job over a year ago, said a 37-year-old saleswoman from Ljubljana, who gave her name as Tanja. We have three children and I find it increasingly hard to make ends meet.

I voted for Jankovic in the hope that things will change for the better, that new jobs will open up.