IN THE confusion of the continuing political crisis in Ukraine, where violence is growing on the ground and the beleaguered president has mysteriously disappeared , one conclusion seems fairly clear: The latest attempt to impose Russian-style autocracy on this pivotal eastern European nation failed.

Two weeks ago, President Viktor Yanukovych rammed through parliament a series of repressive measures aimed at crushing an opposition protest movement. Based on similar laws adopted by the Russian regime of Vladi­mir Putin, they banned many demonstration activities, curtailed the freedoms of speech and the press and required civic activist groups receiving international funding to register as “foreign agents.”

In Russia, Mr. Putin used such tactics to drive a popular movement off the streets of Moscow in 2012. But in Ukraine they backfired. Anti-government demonstrations, which had seemed to be flagging, multiplied across the country, and protesters occupied government buildings in Kiev and in almost every provincial capital.

The result has been a victory for defenders of Ukrainian democracy. On Friday Mr. Yanukovych signed a repeal of the repressive laws and an amnesty for protesters who agree to evacuate government buildings. This came two days after the resignation of his hard-line prime minister and a day after Mr. Yanukovych announced that he was taking a leave from his work, purportedly because of a respiratory illness. It’s not clear if the president’s flu is real or diplomatic. But he is under enormous pressure not only from the opposition, which rejected his concessions as inadequate, but also from Mr. Putin, who has put a promised financial bailout on hold while waiting to see if the government remains obeisant to the Kremlin.

As Secretary of State John F. Kerry tried to point out Friday, Ukraine’s future need not be a zero-sum game between Russia and the West. What’s needed is a compromise between Mr. Yanukovych and the opposition that allows the country to democratically choose its course. That will require more concessions from the president, who already has taken steps to rig the next presidential election in his favor. But it will also require opposition leaders to persuade their followers, including an increasingly radical fringe, not to overreach in their demands or seek Mr. Yanu­kovych’s ouster by undemocratic means.

Mr. Yanukovych may not be willing to go far enough. But even if he is, he may not be able to unless Western governments, particularly in the European Union, are willing to help him. In order to avoid a default, Ukraine must soon obtain financial assistance; if it does not come from Russia, the government will need bridging aid. The European Union should prepare to offer such aid in exchange for a swift move by Ukraine toward agreement with the International Monetary Fund, as well as guarantees of a free and fair election.

Ukrainians have bravely rejected Mr. Putin’s attempt to purchase their country’s sovereignty and erase their freedoms. The West should now make it feasible for their political leaders to make another choice.