For many in the United States and Europe, Ukraine’s future had been bound up with the fate of a former prime minister with halo-like braids who was jailed in an act of political retribution.

Freeing Yulia Tymoshenko, according to this view, would affirm Ukraine’s commitment to the rule of law and democracy. Her release, it was said, would demonstrate Ukraine’s fitness to enter an “association agreement” with the European Union and declare itself a Western nation.

Russian President Vladimir Putin, however, had other plans.

This month he met quietly with Ukrainian President Viktor Yanukovych. Last week, Ukraine said it was dropping its efforts to enter the E.U. agreement — despite months of declaring its intention to sign. Yanukovych spoke of Russian pressure and economic threats — and reportedly even blackmail.

And Tymoshenko? She turns 53 on Wednesday, almost certainly in prison, where she has been for the past two years, serving a seven-year sentence for abuse of power, imprisoned ostensibly because she signed an expensive gas deal with Russia. Her country appears caught between two worlds, desiring the long-term rewards of the West but fearing the immediate reality of Russian threats.

Demonstrators hold up a flag with the face of jailed former Ukrainian prime minister Yulia Tymoshenko during a protest in Kiev, Ukraine, Nov. 24. (Sergei Chuzavkov/AP)

As his critics see it, Yanukovych has surrendered to Russia. For him, Russian threats to disrupt Ukraine’s fragile economy outweighed the benefits that the country would get from releasing Tymoshenko. But by keeping her in prison, he has forfeited the possibility of Western support. And now, critics of Yanukovych say, he has little bargaining power with heavy-handed Moscow.

The turn away from Europe has brought demonstrators out across the country. Over the weekend, 50,000 or more gathered in Kiev, shouting that Ukraine is European. Tymoshenko declared a hunger strike as of Tuesday, demanding that Yanu­kovych change his mind. A petition with more than a million signatures backing the agreement with the E.U., collected over the past three weeks, was delivered to the Ukrainian president on Saturday.

“Only a miracle can change the situation,” Mykhailo Pogrebinsky, head of the Kiev Center for Political and Conflict Studies, said in a telephone interview.

Ukraine decided against the deal with Europe, Pogrebinsky said, because the International Monetary Fund presented unpalatable terms for loans. Russia offered attractive inducements — such as calling off its trade war, which officials said was costing Ukraine about 25,000 jobs every month.

“Yes, Russia must have promised something,” Pogrebinsky said. “Loans, for example. Large ones. Maybe $15 billion. It might have promised something about gas, maybe that they would decrease the price of gas.”

Inevitably, Ukraine’s problems come back to natural gas — and Yulia Tymoshenko.

In 2004, Tymoshenko rose to political glory as a leader of the Orange Revolution, when demonstrators filled Kiev’s Independence Square to protest Yanukovych’s victory in a badly flawed presidential election.

The election was redone. Yanukovych lost. Tymoshenko and others came to power but eventually lost voter confidence. In 2010, Yanukovych beat Tymo­shenko in a tight presidential race. Soon, Tymoshenko faced criminal charges for signing a gas deal with Russia while she was prime minister in 2009. Yanu­kovych described the deal as overly expensive.

Now Ukraine’s financial problems are complicated by a $1.3 billion gas debt to Russia that Yanukovych blames on Tymo­shenko.

“Ukraine suffered financial damage,” Yanukovych said in September. “The courts have to give the response.”

The United States called the prosecution of Tymoshenko selective justice, not arguing her innocence but asserting that she was targeted for political reasons. Last week in the U.S. Senate, Richard J. Durbin (D-Ill.) read a resolution calling on Ukraine to release her.

“Ukraine is our friend and ally. It helped us in Libya and Afghanistan,” Durbin said. “But when you join the community of democracies, you don’t throw your former political opponents in jail over policy disagreements. Instead, you offer better ideas and beat them in elections.”

Freedom House, a Washington organization that monitors human rights around the world, called Ukraine’s E.U. decision a retreat from democracy.

“Yanukovych has decided it’s more important to keep Tymo­shenko in prison than to integrate Ukraine closer toward Europe,” David J. Kramer, Freedom House president, said in a statement. “He has left his country vulnerable to Vladimir Putin’s threats and pressure.”

Ukrainians, who had been negotiating the E.U. trade and political agreement since 2007, argue that Tymoshenko is a more potent symbol elsewhere than at home. Pogrebinsky points out that before entering politics, she was a gas industry executive associated with Pavlo Lazarenko, a former energy minister and prime minister who was found guilty in 2004 of money laundering in the United States.

“She’s not a model of democracy and liberal management,” he said.

Europeans contend that Ukraine is missing the point. “It’s a test of trust and a test of the quality of your leadership,” Radoslaw Sikorski, the Polish foreign minister, told Ukrainian officials at a September forum.

E.U. officials say the agreement, which was scheduled to be signed Friday, would have brought Ukraine investor confidence and new opportunities. On Monday they criticized Russia for intervening.

Turning its back on international support will mean disaster for Ukraine, said Grigory Perepelitsa, an international policy expert in Kiev.

“Kiev will not be able to resist pressure from Russia,” he said. “Ukraine will lose its sovereignty, politically and economically.”

Soon Russia will be pressuring Ukraine to join a Customs Union it has set up with Belarus and Kazakhstan, Perepelitsa predicted, adding that such a union offers few advantages.

“Ukraine needs to start modernizing its economy,” he said. “It needs to introduce new technologies and new equipment. That means a lot of investment. Russia has neither technology nor investment for Ukraine.”

Russia has little to offer beyond promises, Perepelitsa said: “Eventually, Ukraine will face economic collapse, which will lead to very deep political crises with unpredictable consequences.”

Last week, the Baltic News Service reported that Yanukovych had called Lithuanian President Dalia Grybauskaite to tell her that Russian economic pressure and blackmail had forced the decision. Putin countered that Europe was doing the blackmailing.

Russian observers interpreted the decision as pure self-interest. Yanukovych is expected to run again for president in 2015, and he wants no dismal economic news over the next year.

“Today the most important thing for Yanukovych is his political future,” Alexei Vlasov, a Moscow State University expert on post-Soviet countries, told the Kommersant newspaper. “The advantages of integration with Europe are long-term, whereas the adverse effects of a quarrel with Moscow would appear tomorrow.”

So Tymoshenko remains in prison. And demonstrators are back in Kiev’s squares.