Milanovic, a populist whose presidential term expires in February 2025, was prime minister, a more powerful post, from 2011 to 2016.

Milanovic on Friday set April 17 for the parliamentary polls and said he would run for prime minister after dissolving parliament in the small European Union country.

He said he would resign as president only "after winning the polls".

"The President of the Republic of Croatia is a non-partisan individual and he cannot take part in political activities of any party, which excludes a possibility for the President ... to be a candidate on a list for deputies or to be announced as a candidate for a premiere," Constitutional Court president Miroslav Separovic said.

If Milanovic runs for parliament or gives public statements as a future candidate for prime minister, he must immediately file his resignation to the Constitutional Court, Separovic said.

In that event, the parliament speaker would take over as interim president until a presidential election which must be held within 60 days.

At the weekend, Milanovic launched an election campaign along with his Social Democratic Party (SDP), which endorsed him as its candidate for premier.

"We have found that he violated the constitution by his acts and statements from Friday to today, saying that he will run in the election and giving political statements," Separovic said.

The court will monitor the election process and sanction those who violate the constitution, Separovic said, calling on Milanovic and the SDP to halt all anti-constitutional acts.

(Reporting by Daria Sito-Sucic; Editing by Nick Macfie)