THE Ukrainian flag flies again over Sloviansk, a former stronghold of eastern Ukraine’s separatists. Succumbing to some punishing shelling, the rebels retreated on July 5th, leaving behind a city blighted with bullet holes and bombed-out buildings. In areas they had vacated, unexploded mortars lay wedged into the asphalt.

After ending its unilateral ceasefire a week ago, the Ukrainian army has handed President Petro Poroshenko a symbolic and satisfying victory. Yet there is little sign of an end to the fighting that has claimed hundreds of lives in the past three months. Rather the fall of Sloviansk may herald a new phase of hostilities, around Donetsk, the regional capital. And if a protracted insurgency takes hold, Russia’s Vladimir Putin may come under mounting pressure to do more to help than he has done so far.

Mr Putin faces only unpalatable options. Having used state media to propagate the myth of a “genocide” of Russians in eastern Ukraine, he may find dumping the rebels outright to be politically untenable. Mark Galeotti of New York University argues that “Putin can’t just walk away.” On the other hand, escalation through more overt transfers of humanitarian aid, weapons and fighters would leave a struggling Russian economy vulnerable to further Western sanctions and its forces potentially bogged down in an intractable conflict.

Russian officials, including Sergei Lavrov, the foreign minister, have taken to saying that a negotiated settlement is their preferred solution. State propaganda has been toned down. Russia badly needs a deal with Kiev to supply Crimea, which it annexed in March, with water, electricity, gas and food. The threat of more sanctions is rattling Russian business.

The rebels, however, are not listening. They are calling the retreat from Sloviansk “a tactical decision”, and fortifying Donetsk for battle, building new checkpoints, blowing up bridges around the city and hunkering down in student dormitories. Leaders of Donetsk’s “people’s republic” complain that Mr Putin is not doing enough to help. They pledge to fight a real partisan war. Moscow has “a degree of influence” over the people’s republics, says Dmitri Trenin, director of the Carnegie Moscow Centre, “but no real control”.

Mr Poroshenko, for his part, appears emboldened. A spokesman for the National Security and Defense Council claims that rebels in Donetsk and Luhansk are in for a “nasty surprise”. The army has retaken several smaller, lightly guarded cities on the road to Donetsk. On July 8th Mr Poroshenko donned snappy fatigues to congratulate his troops in Sloviansk (pictured above). He promised to restore services to residents who have been without water or electricity for several weeks.

Since declaring an end to the ceasefire, he has replaced his defence minister and his chief of the general staff. He wants an army that will carry out his orders even if the result is bloody. Several things have improved the effectiveness of the armed forces. After nearly 20 years of neglect, they are being properly paid and have money to maintain equipment. American non-lethal assistance in the form of lightweight body armour and night-vision goggles has boosted morale. The supply by Russia of a few old tanks to the rebels in early June proved a tipping point in terms of the Ukrainian army’s willingness to fire on fellow citizens.

Mr Poroshenko, whose political survival hinges on fulfilling a promise to pacify the country, faces pressures of his own, including from far-right elements. Oleh Lyashko, a nationalist politician from the Radical Party who took over 8% of the vote in May’s presidential election, went to Sloviansk this week. Meeting a local politician in the city’s administration building, Mr Lyashko, wearing body armour and carrying a holstered pistol, launched into a tirade, forcing the man to write and sign a resignation letter ending with: “Glory to Ukraine, death to the occupiers!”

If the smouldering remnants of Sloviansk are any guide, the price of military victory in the Donbas could be devastating for Mr Poroshenko. He would be saddled with steep reconstruction costs and a deeply fractured region that Ukraine can ill afford. Referring to newly arrived Ukrainian forces in Sloviansk, an elderly resident, Tamara Khanina commented bitterly: “They bombed us, so how should I feel about them?” Mr Poroshenko also has to reckon with groups of men who, if not numerous, have found meaning in their lives by fighting against his government.

In Donetsk, a city of a million inhabitants, the next battle has already begun. Despite assurances that the government would not use air strikes, on July 8th Ukrainian forces hit a rebel position near an abandoned coal mine. The longer the fight goes on, the more likely it is that Mr Putin will feel forced to intervene. The Kremlin could provide better kit for the rebels or impose a no-fly zone, says Mr Galeotti. Such steps would allow Russia to exploit its superior air power, leaving Ukrainian soldiers no option but to engage the insurgents in close-quarter combat on the streets—just the kind of fighting that regular armies hate.

Igor Sutyagin, a Russian analyst at RUSI, a London-based think-tank, says that, if Kiev’s forces were to use the same tactics in Donetsk that proved successful in Sloviansk, it could lead to “a disaster, strategically and militarily” for Mr Poroshenko. But he thinks they can afford to be patient, because the insurgents have little local support and may number no more than about 15,000, a third of them from Russia. Mr Sutyagin reckons that, although Mr Putin is happy for instability to continue in eastern Ukraine, he will not do a lot more to help the rebels. Russian forces over the border have turned back separatists seeking sanctuary: the last thing Moscow wants is for the fighting to spread into Russia. For now, an edgy stalemate may suit all sides better than an escalation with potentially catastrophic consequences.