Petro Poroshenko has a terrifyingly difficult task. As Ukraine’s president-elect, he has to try to keep his country together.

Poroshenko, known as the “Chocolate King” thanks to his fortune in Ukraine’s confectionery industry, carried the presidential election on May 25 with over 55 percent of the vote, giving him a mandate that even Moscow won’t find easy to contest. Far-right parties did miserably. That puts paid to the propaganda meted out by Russia’s state-run media that Ukraine’s interim government was run by fascists and anti-Semites.

Poroshenko’s first-round victory also means that Ukraine was spared a bitter run-off between him and Yulia Tymoshenko. The former prime minister won only 15 percent of the vote. That confirmed all the opinion polls that Ukrainians wanted a break with a past dominated by corruption, mismanagement, and broken promises. Above all, they voted for Poroshenko because they wanted an end to instability and the chance to build a state.

Over the past decade, successive Ukrainian leaders had chiseled away at the very foundations of the state. Ministries and state-owned companies, particularly in the energy sector, as well as the security forces are rife with corruption. By the time Viktor Yanukovych was ousted from the presidency in February, the Ukrainian state barely functioned. It had been stripped of all integrity.

This explains to some extent why Ukraine’s security forces were unable to stop Russia from taking over the Crimean peninsula or why they could not prevent pro-Russian militia groups from taking over parts of Eastern Ukraine. By default, it was often left up to powerful local oligarchs to restore some kind of order. Over the past quarter of a century, politics in Ukraine have been substituted by the rule of oligarchs.

Poroshenko, himself an oligarch, owner of a television station, and enormously rich, now faces the task of moving Ukraine away from an oligarchy. If Ukrainian democracy, which was so hard fought for on Kiev’s Independence Square, is to survive, Poroshenko has to rebuild the state as a functioning set of independent institutions.

But he is not in control of the whole country—large parts of Eastern Ukraine have fallen to pro-Russian militias. To make matters worse, the new president lacks proper state institutions that he could work with to regain territorial control of the East.

Eastern Ukraine could not even vote properly in the presidential election. Militia groups raided polling stations and intimidated the population so much that 10 percent of Ukraine’s overall electorate did not vote.

In the Donbas region, where Ukraine’s coal mines are based, the polling places did not even open. According to a Reuters report, rebels scoffed at the “fascist junta” and announced a plan to “cleanse their people’s republic of enemy troops.”

During his victory speech in Kiev on May 25, Poroshenko said his first visit would be to the Donbas. He said he was prepared to consider some aspects of regional autonomy and to respect language rights. “To people who have taken up arms but are not using them, we are ready to grant an amnesty,” he told a news conference. “As for those who are killing, they are terrorists, and no country in the world conducts negotiations with terrorists,” he added.

Much depends on Vladimir Putin. The Russian president has already successfully annexed Crimea. The hand-wringing by the EU and the United States and the sanctions they have imposed on Russia are unlikely to reverse that annexation. Moreover, Russia’s interference in Eastern Ukraine has had the result that Moscow wanted: a divided and unstable Ukraine.

Will Putin accept the legitimacy of the ballot? He said before the poll that its result would count. But the deputy speaker of the Russian State Duma and a leading member of Putin’s United Russia party, Sergei Neverov, wrote on Facebook: “It is hard to recognize the legitimacy of elections when tanks and artillery are wiping out civilians and a third of the population is driven to the polling stations at gunpoint.”

It won’t be easy for Poroshenko to counter that disinformation. Nor will it be easy for him to regain control of the pro-Ukrainian civil defense groups that have sprung up to protect what is left of Ukraine’s territorial integrity. If these units are not convinced that Poroshenko can regain control of the East, they could continue waging their own armed struggle against the separatists.

Under such complex circumstances, the EU can’t do much except support Poroshenko politically and send expert advice to assist in institution building. It should also begin disbursing some of the €11 billion ($15 billion) it pledged to the interim government. Such funding is conditional on Kiev implementing major reforms.

Poroshenko, who will need enormous political will to end Ukraine’s corruption, will have to move fast with reforms. At least he has been given a clear mandate to do just that.

As for being president of all of Ukraine, that will be up to Russia. Poroshenko has said he is ready to negotiate with Putin, calling Russia a vital partner. Let’s see how Putin will respond.