BUCHAREST (Reuters) - The head of Romania’s ruling Social Democrat party, Liviu Dragnea, was sentenced to three and a half years in prison by the Supreme Court on Thursday for inciting others to abuse of office, prompting thousands to rally against his government.

Slideshow ( 2 images )

Dragnea, who is also speaker of the lower house, was found guilty of keeping two women on the payroll of a state agency in 2006-2013 even though they were employed by his party.

Romania’s most powerful politician, he has repeatedly denied all the charges and is expected to appeal the verdict, which relates to when he was a county council chief.

A fresh criminal conviction for Dragnea, who is already barred from becoming prime minister because of a previous conviction for vote-rigging, could weaken his grip on Romania’s biggest party and the five-month-old government.

He will not be jailed before an appeal is heard and the court issues a final verdict, but more than 5,000 people gathered outside the government headquarters demanding the resignation of Dragnea as speaker as well as of Prime Minister Viorica Dancila, his Social Democrat ally.

“Thieves, resignation, resignation,” shouted the crowds. Several more thousand rallied peacefully in smaller cities across the country including Transylvania’s Sibiu and Cluj.

Under the Romanian legal system, Thursday’s sentence is preliminary. He will be able to remain party leader and speaker while the legal process continues.

Arguments about how to fight corruption in one of Europe’s most graft-prone states have dominated Romanian politics since it joined the European Union just over a decade ago and magistrates have often complained of political pressures.

“Today’s ruling is a courageous act by Romanian magistrates, it is of paramount significance for the judiciary,” said political commentator Cristian Tudor Popescu.

At the start of 2017, attempts by Dragnea’s coalition government to weaken anti-corruption legislation triggered the country’s biggest protests in decades.

This week parliament approved legal changes that critics said could encourage criminals to act with impunity, the latest twist in a regional drama that has exposed the fragility of eastern Europe’s post-communist democracies.

Dragnea was cleared of a separate, intellectual forgery charge on Thursday, the court said.

A final verdict, following his appeal might take months, analysts say, with magistrates on summer recess for two months until the start of September.

Top Social Democrats will meet on Friday and analysts expect them to voice their support for their leader. Several senior members have already denounced the ruling as politically-motivated.