Their country is divided by a war that has killed thousands and displaced more than a million people.

And yet when polled on which is more urgent — the war against pro-Russian rebels or the war against corruption — Ukrainians say it's corruption, by a margin of more than two-to-one.

Such is the scale of disgust with what is seen as rampant thievery by many of Ukraine's ruling elite.

And the current president of Ukraine, Petro Poroshenko, has been at times a reluctant recruit to the anti-corruption campaign.

Despite that hesitancy, Prime Minister Justin Trudeau paid a visit to Ukraine earlier this month. While there, he signed a free trade agreement with Poroshenko and pledged Canada's continuing support for the nation as it battles Russian-backed rebels.

Poroshenko is Europe's richest leader, according to Forbes. The leaked Panama Papers recently revealed that in August 2014, as Ukraine's army retreated from its bloodiest defeat of the war, Poroshenko was registering an offshore company in the British Virgin Islands.

Poroshenko showed his frustration with the topic of corruption during his news conference with Trudeau in Kyiv, where he clearly preferred to talk about Russian aggression than answer questions on the issue.

"Minsk Agreement (to end the war) is not about the fighting against corruption," he said to reporters when asked what efforts he was making to end corruption in his country. "Minsk Agreement is about the de-occupation of Ukrainian territory."

Prime Minister Justin Trudeau reviews an honour guard with Ukrainian President Petro Poroshenko in Kyiv on July 11. (Adrian Wyld/Canadian Press)

Poroshenko is correct about the agreement. But foreign donors' frustration over corruption has reached a point where it is endangering their continued support for Ukraine.

It's also hurting investment. The president of the American Chamber of Commerce in Ukraine, Andy Hunder, recently warned in an interview with the English-language Kyiv Post that his members want "to see some of these big fish going down and being brought to accountability for everything that's been stolen — and the way the country has been raped for the last number of years."

Foreign pressure grows

When Poroshenko came to power in 2014, he was praised for bringing in Lithuanian-born reformer Aivaras Abromavicius as his economy minister.

But after more than a year of battling the system, Abromavicius resigned, saying, "Neither I, nor my team, have any desire to be a cover for open corruption," according to a report in the Washington Post.

Anastasia Krasnosilska of the Anti-Corruption Action Center of Ukraine, said Poroshenko has only tackled abuses because of foreign pressure and then only after lengthy foot-dragging.

Ukraine's former economy minister Aivaras Abromavicius resigned after more than a year of battling the system. (Sergei Chuzavkov/Associated Press)

"All recent successes in the fight against corruption were made possible because of pressure from the EU, IMF, and civil society," she said to CBC News. "If it weren't for the conditionalities the foreign donors and lenders imposed, and the feeling that the eye of foreign governments is on Ukraine, there would have been no reform."

Krasnosilska says the single most positive step has been the creation of the National Anti-Corruption Bureau of Ukraine, and the appointment of honest investigators to lead it.

But she says that was only possible because the selection panel that appointed NABU's investigators included one representative each from the U.S. Embassy, the Canadian Embassy, and the EU mission to Ukraine, who had the power to veto people nominated by Poroshenko and the parliament.

Oligarchs loot the country

Ukraine's reputation for widespread corruption is tied to how its well-connected oligarchs have looted the country using two key strategies: raiding companies and bank fraud.

"NABU has begun 150 investigations and brought 20 cases to the courts," she said. "but the courts are blocking them, refusing to issue warrants, or leaking warrants."

In one case, she said, NABU investigators recorded the judge handling one of their corruption cases as he called the person under investigation to warn him there was a wiretapping warrant against him.

Krasnosilska says Ukraine now needs an independent anti-corruption court, with judges appointed by the same foreign-vetted screening process.

Legal harassment

Far from assisting the Anti-Corruption Action Centre, a foreign-financed NGO, Poroshenko's government has targeted it for legal harassment over supposed irregularities in its foreign funding. His former chief prosecutor Viktor Shokin, notorious for his refusal to prosecute actual corruption, continued to pursue the Anti-Corruption Action Centre in the courts as recently as May.

Shokin was eventually removed from office after U.S. ambassador Geoffrey Pyatt threatened to stop all aid if Shokin wasn't fired. But, according to the Kyiv Post, Poroshenko dragged his feet for six months before letting him go.

"It wasn't me talking on Shokin," Pyatt told the Kyiv Post. "It was the United States government. The conditionality of getting rid of Shokin was an important step to at least opening the door to reform the prosecutor's office."

Viktor Shokin, Ukraine's former general prosecutor, was removed from office. (Sergei Chuzavkov/Associated Press)

Trudeau made a point of meeting with staff of the Anti-Corruption Action Centre during his visit to Kyiv. But Canada has been less vocal on Ukraine's corruption than some other countries, not because Canada is unaware of the issue, but rather because it is reluctant to squeeze the country too hard as Ukraine confronts proxy Russian forces in the east.

It's not the right moment, officials say, to break the system and start to rebuild it.

Krasnosilska said Canada needs to put more conditions on its aid, "and the conditions should be on the basis of prior action. In other words, first you make the reform, then you get the money."

Getting better?

Paul Grod, the Ukrainian-Canadian CEO of Rodan Energy and president of the Ukrainian Canadian Congress, told CBC News, "There's no question that things have happened that left a bad taste in everyone's mouth, and that cost Ukraine investments."

But he also sees signs of change.

"The problem has been rule of law and the lack of an independent judiciary free from corruption. We're seeing significant inroads in that regard, but there's still a long way to go," he said.

Grod said he's optimistic that the foreign investment protection clauses in the new Canada-Ukraine Free Trade Agreement will give Canadian businesses more confidence that their assets won't be seized. He's also encouraged to see a new generation of younger and more honest leaders beginning to enter government.

National Bank chief Valeria Gontareva speaks to lawmakers during a session of the parliament in Kyiv. (Sergei Chuzavkov/Associated Press)

But much of the old guard remains and continues to cost Ukraine money.

According to the Kyiv Post, the IMF is planning to reduce a loan to Ukraine from a planned $1.7 billion to $1 billion over corruption concerns.

Valeria Gontareva, Poroshenko's Porsche-driving political ally and business partner who now heads the National Bank of Ukraine, says she isn't concerned. "It's not a big deal for us," she told the publication, although the shortfall is equal to the total amount Canada has given to Ukraine since the Maidan rebellion ended in February 2014.

Gontareva added that she would continue to keep secret the identities of the people who took out billions of dollars in bad loans from her bank. "Like a regulator, I believe that bank secrecy should be there."