Clashes broke out Friday night in the Slovenian capital of Ljubljana as angry demonstrators tried to push through a police cordon to storm parliament and police used water cannon and tear gas to repel them.
At least 15 people were injured and 30 were arrested in what turned into a street battle between the police and groups of hooded young extremists throwing rocks, bottles and firecrackers at them.
This was the second time this week that anti-government protests in Slovenia turned violent - an extremely rare development in the otherwise calm Alpine nation.
But tensions have been soaring before a presidential runoff vote this weekend. Slovenia has been struggling economically and is in danger of needing an international bailout.
Thousands joined the protests in Ljubljana on Friday against Prime Minister Janez Jansa and his Cabinet, accusing them of corruption and fraud and demanding their resignations.
The gathering started off peacefully. Carrying banners that read "You are finished" and "Thieves," about 8,000 people braved the drizzle and cold to express their discontent with government cost-cutting measures and other reforms designed to avoid an international bailout.
Clashes erupted at the end of the demonstration after smaller groups attacked the police guarding parliament and other state buildings. Similar clashes marred the protest earlier this week in the second-largest city of Maribor.
Slovenia is facing one of the worst recessions of the 17 nations that use the euro currency. Its economy has shrunk more than 8 percent since 2009 and continues to decline, resulting in a sharp drop in exports and living standards and a surge in unemployment, which now stands at about 12 percent.
Sunday's vote pits incumbent President Danilo Turk against former prime minister Borut Pahor.
Many among Slovenia's 2 million people are angry with their leaders' inability to join forces and pull the country out of its economic crisis. They are also upset over austerity measures - spending cuts and tax hikes - which they say target the poor rather than the rich.
According to an opinion poll published Friday in the Delo daily, Pahor will win about 55 percent of the vote, while Turk will garner 24 percent. The poll was conducted among 780 people with a 2.5 percent margin of error.
Pahor told the AP on Friday that the protests "signal a lack of confidence" in government institutions.
"It is important that by not using force we give people hope that all problems can be solved," he said.
The 49-year-old has supported some of the government's reform measures, unlike current president Turk, who has been a fierce critic.
Jovana Gec in Belgrade, Serbia, and Amer Cohadzic and Eldar Emric in Ljubljana contributed to this report.