Polls have closed in Croatia's presidential election with preliminary results indicating a win for former Prime Minister Zoran Milanovic.

With 54 percent of the votes counted, the State Electoral Commission said on Sunday that the Social Democrat candidate got 54 percent of votes ahead of the incumbent centre-right President Kolinda Grabar-Kitarovic of the governing HNZ party.

More:

Opinion polls had suggested Milanovic's triumph, though with a smaller margin. Grabar-Kitarovic, who took 46 percent of the vote, has struggled to unite a fractured right wing.

The presidential role is to a large extent ceremonial as the head of state cannot veto laws but has a say in foreign policy, defence and security measures.

The next president's five-year term will begin in February.

Some 3.8 million people were eligible to vote in the runoff poll, which followed a heated first round in December.

The vote comes as the European Union's newest member is struggling with corruption, a lacklustre economy and a large exodus of its population seeking better opportunities abroad.

Unity, patriotism and references to the 1990s independence war, which remains an emotive issue, featured heavily in Grabar-Kitarovic's re-election bid, while Milanovic told voters that the "wars are over" and Croatia should now focus on its role in the EU.

Milanovic, who tried to shake off a reputation as an arrogant elitist, ran his campaign on promises that he would fight the corruption he said had intensified since the conservatives took power.

A prime minister from 2011 until 2016, he was welcomed at the time of assuming office as a bright, young politician clean of the corruption tainting the rival HDZ.