On Friday, in the incongruous setting of a Welsh golf resort, President Petro Poroshenko stole the headlines from a tub-thumping Nato by announcing that talks in Minsk had produced a ceasefire agreement for Ukraine. Just days on, after new outbreaks of shelling around Donetsk airport and the port of Mariupol, the most optimistic description of the ceasefire is that it is “fragile”.

Fragile it may be, but the terms of the Minsk agreement, and the route to peace that it charts, represent the best chance there has been to end the fighting, and there are compelling reasons not to give up on them quite yet.

A central question is whether the latest shelling signifies bad faith on the part of Russia or actually demonstrates, as Moscow has insisted, that its control over the separatist fighters is less than western governments believe. That question remains open. But there are compelling reasons why Putin, like Poroshenko, if not the rebels, may genuinely want the fighting to end now – and, indeed, why Putin may be in a better position than before to make it happen.

Poroshenko’s interests are clear: after initial successes, his forces have been losing ground and risk losing more. The conduct of the Ukrainian forces has started to attract criticism from human rights organisations. On the political front, having called early parliamentary elections, Poroshenko needs some minimal accommodation with the east if the country is to hold together.

The considerations pushing Putin towards a settlement are perhaps less clear, but also urgent. When the Russian president said recently that he could “take Kiev in two weeks if I want to”, this was widely interpreted as a threat. What he appeared to mean, though, was that “we could have taken the whole of Ukraine weeks ago, but that was not, and is not, our intention”. Construed like this, it amounts to a welcome, if implicit, acceptance of Ukraine’s current borders – and a key principle of any peace agreement.

This makes far more sense than designs on Kiev. Putin faces growing economic problems at home, only in part because of sanctions. Why would he want to take on the huge liabilities of eastern Ukraine? It is clear why Russia wanted Crimea: to prevent its only warm water port falling sooner or later into western hands. Russia’s chief concern in eastern Ukraine is to ensure that the mostly Russian-speaking east Ukrainians are not railroaded into a state where they fear being disenfranchised.

The projected peace agreement gives the east a “special status”, including a large amount of autonomy. That would be a gain. It is also something that Putin can present at home as having been worth the fight. Giving up all claim to Ukraine, which is the effect of the projected peace agreement, is a risk for Putin domestically. But so is the prospect of more Russian casualties. As Putin surely knows, Russian opinion could tip against him as quickly as it rallied to him after Crimea.

Putin may also be in a better position to bring the rebels to heel than he was before. If, as it appears, the rebels’ recent advances were made largely thanks to Russian help, then that help can be withdrawn. Plus the rebel leaders now have their own investment in peace. In a key concession by Poroshenko, they were party to the Minsk agreement. Their credibility, as well as that of the two presidents, is now on the line.

There is, of course, plenty of room for caution, and not just about the response of the fighters on the ground. Poroshenko’s authority is not what it was after he won the presidency in May. And if he cannot honour his part of the bargain, Putin could decide not to honour his. The east-west confrontation feared for so long would thus come a significant step closer – which is why everyone, not only the signatories, has an interest in making this ceasefire work.