Ukrainian President Petro Poroshenko warned on Thursday that the country risks defaulting on its debt if its biggest lender, PrivatBank, is handed back to a controversial tycoon.

"Such a reckless move... threatens a default and a new economic crisis," Poroshenko said in a video address three days before a presidential election that polls show him losing.

"Tens of millions of clients" will also lose their money, added Poroshenko, who will face political novice Volodymyr Zelensky in the runoff vote on Sunday.

A Kiev court ruled Thursday that the Ukrainian government's decision in 2016 to nationalise PrivatBank, owned at the time by tycoon Igor Kolomoysky, was illegal.

Comedian Zelensky, whose shows are broadcast by Kolomoysky's television channel, has emerged as a favourite in the presidential race after his surprise decision to run.

Zelensky has denied that he is in the employ of Kolomoysky or that his policies would favour the billionaire, and the two insist their ties are purely professional.

PrivatBank was nationalised after authorities blamed Kolomoysky and other bank owners for issuing bad loans to cronies and having insufficient capital to stay afloat.

The Ukrainian central bank said it would appeal against the court ruling.

"The court decision has not yet entered into force and will be appealed by the National Bank," it said in a statement.

PrivatBank -- the nationalisation of which was welcomed by the West -- holds more than a third of Ukraine's deposits.

Ukraine's government has spent nearly 140 billion hryvnyas (around $5 billion) on recapitalising the lender to cover the losses caused by the withdrawal of money from the bank and poorly-secured loans handed out before the nationalisation.