When world leaders pull an all-nighter, something has to come out of it. What came out of the 17-hour, Ironman-level endurance test last week in Minsk was a cease-fire deal for eastern Ukraine that mitigates the Kiev government's defeat in a war it could not have won, gave Russian-backed rebels two days to make final territorial gains and freezes the conflict until next year.

The challenge now is to make this cease-fire stick where previous ones didn't. It's not clear if Russian President Vladimir Putin, who has proven to be an unreliable negotiating partner in recent months, will stand by the few concessions he made.

If he can be held to them, it will be a major diplomatic victory for German Chancellor Angela Merkel. My bet, however, is that this is not the final round of high-level talks: The deal resulting from the negotiating marathon is too contradictory to work long term.

Two separate documents came out of the meeting: an empty declaration, in which the negotiating parties affirm "full respect for the sovereignty and territorial integrity of Ukraine," and a three-page, 11-point document purporting to be a road map to the implementation of last September's cease-fire agreement. It is, in fact, a new deal, more favorable to the Russian-backed rebels than the September agreement.

According to it, fighting was to cease at midnight Feb. 15. The Ukrainian military was to pull back its artillery at least 50 km from the current separation line, which the rebels have moved significantly in recent months:

In a meaningless compromise, the rebels were supposed to pull back the same distance from the line agreed to in September. This means, in theory, that neither side will be able to shell the other's territory.

It also means the pro-Russian forces get to keep all they have won in the period since September, and probably all they added in the two days during which fighting was still permitted, according to the document.

Kiev is called on to observe a now-disused law passed by the Ukrainian parliament in September granting special status to the rebel-held territories. It's supposed to call local elections in those areas and clearly determine their borders — but only in accordance with the September deal.

This is a clear contradiction with the military part of the new agreement, leaving separatist gains of the last five months in limbo, formally ruled from Kiev but militarily held by the rebels.

This is a time bomb under today's deal that Russia could detonate at any moment if it is unhappy with Ukraine's compliance with the rest of the terms.

Russia has already shown its negotiating partners how that could happen: The leaders of the two self-declared "people's republics" of eastern Ukraine, who were present in Minsk but not taking part in the main talks, briefly refused to approve the deal about an hour before it was made public, although they eventually signed on.

The remaining terms strengthen the rebels' position, putting the onus of maintaining peace on Ukraine. Kiev is supposed to give amnesty to all the rebel fighters, restore the banking system in the "special status" areas and resume the payment of pensions and social benefits to residents there.

In a major departure from the September agreements, Ukrainian control of its border with Russia is only to resume by the end of 2015, after local elections are held and after Ukraine conducts constitutional reform granting permanent autonomy to the rebel areas, which include the two biggest cities in the east — Donetsk and Luhansk.

This proposed reform is described in some detail in the document. It would grant the local governments the right to form their own police forces and a say in appointing prosecutors and judges. Ukraine would be unable to strip local government members of their powers, and the autonomous regions would have the right to choose their own official language — which is certain to be Russian rather than Ukrainian.

"Russia is a federal state, but our regions can only dream of even a tenth of these powers," top Russian anti-Putin opposition figure Alexei Navalny tweeted after reading the Minsk document.

Contrary to previous suggestions from Moscow, the eastern regions will have no veto over Ukraine's foreign policy decisions. Ukraine, however, is unlikely to be able to join the North Atlantic Treaty Organization anytime soon, a point French President Francois Hollande emphasized before the talks. The situation is far too volatile for that, and the threat of hostilities resuming will be a Damocles' sword hanging over both Ukraine and NATO.

All in all, the agreement is as close to a deal on Putin's terms as decency allows. That's why, as he came out of the talks in an apparently breezy mood, he quipped that this was "not the best night of his life but a good morning."

Though the deal doesn't grant Putin his ultimate wish — to keep Ukraine within Russia's orbit economically and politically — he couldn't have hoped for that without a decisive military victory. The optics are good for him domestically, though, and Putin can hope to cut the costs of war, including those imposed by the Western economic sanctions.

Ukrainian President Petro Poroshenko, for his part, will find it hard to spin the deal as his victory. It's no wonder he stormed out of the meeting room several times during the night and even told an AFP reporter that Russia's position in the talks was "unacceptable" — less than two hours before accepting the agreement. Both Merkel and Hollande placed a special emphasis on praising him in their remarks after the talks, and they also invited him to a European Union summit in Brussels. Poroshenko's consolation prize is even if his country is still being violated, the Western leaders are willing to treat him as an ally.

Merkel said after the talks that she had "no illusions" and just a "glimmer of hope" that things will work out. It's true that any truce will be shaky. Fiercely patriotric Ukrainians who backed Poroshenko in recent elections, and especially the volunteer fighters in the east, are likely to consider it a betrayal of their efforts. The rebels and their Russian puppet-masters will still want territorial expansion and stronger guarantees that Ukraine will not become a full-blown member of Western alliances.

Still, if the artillery remains silent, Ukraine will finally get a chance to develop peacefully and to break with its post-Soviet habits of bad governance and endemic corruption.

Putin will get some much-needed economic breathing space and a path toward restoring a workable relationship with at least some Western partners.

And EU leaders will breathe a huge sigh of relief at having staved off interference by U.S. hawks, who have been insisting on arming Ukraine.

These are all worthy achievements, and the participants in the talks should be congratulated for not quitting. Even if this particular truce doesn't hold, it's clear there is a strong will to look for a lasting solution.

Berlin-based writer Leonid Bershidsky is a Bloomberg View contributor. He was the founding editor of Russia's top business daily, Vedomosti.