KIEV On September 4, Ukrainian President Viktor Yanukovich called a meeting of his political party for the first time in three years, summoning members to an old Soviet-era cinema called Zoryany in Kiev.
For three hours Yanukovich cajoled and bullied anyone who pushed for Ukraine to have closer ties to Russia. A handful of deputies from his Party of Regions complained that their businesses in Ukraine's Russian-speaking east would suffer if Yanukovich didn't agree to closer ties with Russia. That set him off.
"Forget about it ... forever!" he shouted at them, according to people who attended the meeting. Instead the president argued for an agreement to deepen trade and other cooperation with the European Union.
Some deputies implored him to change his mind, people who attended the meeting told Reuters. Businessmen warned that a deal with the EU would provoke Russia - Ukraine's former master in Soviet times - into toughening an economic blockade on Ukrainian goods. Yanukovich stood firm.
"We will pursue integration with Europe," he barked back, according to three people who attended the meeting. He seemed dead set on looking west.
Less than three months later Yanukovich spurned the EU, embraced Russian President Vladimir Putin and struck a deal on December 17 for a bailout of his country. Russia will invest $15 billion in Ukraine's government debt and reduce by about a third the price that Naftogaz, Ukraine's national energy company, pays for Russian gas.
It is not clear what Yanukovich agreed to give Russia in return, but two sources close to him said he may have had to surrender some control over Ukraine's gas pipeline network.
What caused the U-turn by the leadership of a country of 46 million people that occupies a strategic position between the EU and Russia?
Public and private arm-twisting by Putin, including threats to Ukraine's economy and Yanukovich's political future, played a significant part. But the unwillingness of the EU and International Monetary Fund to be flexible in their demands of Ukraine also had an effect, making them less attractive partners.
And amid this international tug-of-war, Yanukovich's personal antipathy towards his jailed political rival, Yulia Tymoshenko, was a factor, according to Volodymyr Oliynyk, an ally of Yanukovich and a prominent member of the ruling party. The EU accused Ukraine of treating Tymoshenko unfairly - to the annoyance of Yanukovich, according to his supporters and one of her lawyers.
The upshot is that Yanukovich, 63, has split his party and his country. Some leading party officials have deserted him. His hopes of re-election in 2015 - if there is a free and fair vote - look weak.
Hundreds of thousands of protesters have taken to the streets, demanding he step down and the country pursue closer links with the EU. Yanukovich, who has been increasingly cut off in his sprawling residence outside Kiev and distant even from some of his oldest friends, did not respond to requests for comment.
Risen from humble roots, Yanukovich likes to be treated with respect and as an equal, a characteristic that has informed much of his reluctance to join the customs union of former Soviet states that Putin wants to create.
Colleagues describe the burly leader as an intuitive politician who cannot abide being patronised. Inna Bohoslovska, a member of Yanukovich's Party of Regions until last month, said Yanukovich made clear at the cinema meeting his dislike of Russia treating Ukraine as second rate.
"He told us Russia was not fit for talks, Russia did not consider Ukraine to be an equal partner, that it tried to force us to act by its own rules, that Russia does not act in Ukraine's best interests in any negotiations, and therefore there can be no talk of having negotiations with Russia," she said.
Yanukovich felt he was better treated by EU officials, two party members said, despite finding it hard to grasp the complexity of EU bureaucracy. Hailing from Ukraine's industrial east, Yanukovich also seemed the perfect man to persuade Ukraine's pro-Russian eastern regions to agree to closer ties with Europe.
"That a president from the east would bring Ukraine into Europe was the ideal combination for us. We were willing to do anything," said David Zhvaniya, a former member of the Party of Regions who helped lead efforts to prepare Ukraine for deeper cooperation with the EU.
Now deeply disillusioned, Zhvaniya feels misled by Yanukovich: "He tricked us all ... It was a complete, utter lie." He accuses Yanukovich of acting like a tsar.
Others say Yanukovich's desire to forge closer links with the EU was genuine, but that he became dismayed when he felt the EU failed to acknowledge the scale of the financial difficulties he would face if he chose Brussels over Moscow.
Yanukovich estimated that he needed $160 billion over three years to make up for the trade Ukraine stood to lose with Russia, and to help cushion the pain from reforms the EU was demanding. The EU refused to give such a sum, which it said was exaggerated and unjustified.
The EU offered 610 million euros ($839 million) immediately. EU officials said increased trade, combined with various aid and financing programmes, might go some way to providing Kiev with the investment it needed.
An EU source said Ukraine could have been in line to receive at least 19 billion euros in EU loans and grants over the next seven years if it had signed a trade and cooperation agreement and reached a deal with the IMF. But that sum was not mentioned to Ukraine officials during negotiations, said the source.
To Ukraine, there seemed little prospect of getting the EU, already struggling to help its indebted members, to offer a better deal than its original offer.
Oliynyk, who is Ukraine's permanent representative for NATO, and others were furious. He told Reuters that when Ukraine turned to Europe's officials for help, they "spat on us."
Next year Ukraine will have to cover foreign debt payments of $8 billion, according to its finance ministry. It was teetering on the brink of bankruptcy, partly because Moscow was blocking sales of Ukrainian-produced meat, cheese and some confectionery, and scrapping duty-free quotas on steel pipes. Some officials said the restrictions showed what life would be like if Ukraine signed the EU agreement.
Yanukovich's other hope was the IMF. It rescued Ukraine during the onset of the global financial crisis with a $16.5 billion loan in 2008 when Tymoshenko was prime minister. It also approved a $15.5 billion stand-by programme for the Yanukovich government in 2010, disbursing about $3.5 billion, before freezing the programme in 2011 because Ukraine failed to meet its conditions. A year later, the programme had expired.
The IMF, like the EU, was unwilling to grant the sort of loans Yanukovich wanted under a new programme. In a letter dated November 20, it told Ukraine that it would not soften conditions for a new loan and that it would offer only $5 billion, Oliynyk said. And Kiev would have to pay back almost the same amount next year, he said, as part of repayments for the earlier $16.5 billion loan.
The IMF declined to comment. According to IMF figures, Kiev should pay back $3.7 billion next year.
"We could not contain our emotions, it was unacceptable," said Oliynyk.
Yanukovich was furious, party members said. He believed the IMF had ignored what he saw as reasonable demands to lift tough conditions for its earlier help, such as increasing the retirement age and freezing pensions and wages. Worse, the IMF was asking him to repay a loan that had been negotiated by his arch enemy, Tymoshenko.
JUSTICE ON TRIAL
Despite his reputation as a hard man - he was sent to Soviet prisons twice for theft and assault when he was a youth - Yanukovich has a particular weak point: jailed opposition leader Tymoshenko. He both detests and fears her, according to his aides and diplomats.
Conspicuous for her plaited blonde hair, Tymoshenko was one of the leaders of the 2004 Orange Revolution, which snuffed out Yanukovich's first bid to be president. She served as prime minister in 2005 and then from 2007-2010, and their enmity deepened when a plan to form a coalition against a common enemy failed in 2009.
Tymoshenko, who has said she wanted to "kill" Yanukovich over his policy U-turn, was jailed in 2011 for abuse of office after a trial Western governments say was political. Most Ukrainians think she should be released, though many question how she amassed her wealth.
To the EU, Tymoshenko's case represented an unacceptable standard of justice. As part of the trade pact, the EU demanded Ukraine release Tymoshenko or, as some officials suggested, make a commitment to do so.
Yanukovich and his supporters resisted. "We had done most things on the list for the EU accession agreement, but there was a question mark over Tymoshenko ... We believe she is guilty ... and among those people who think she is guilty, 80 percent are our voters," Oliynyk said, going on to document the dozens of perceived slights Tymoshenko has made against Yanukovich.
Tymoshenko has never acknowledged his legitimacy as president and refuses to ask for forgiveness so he can pardon her, he said.
Serhiy Vlasenko, a lawyer for Tymoshenko, said his client was a factor in Yanukovich's decision not to accept a deal with the EU: "He (Yanukovich) had dozens of reasons not to sign it, and yes, one of the reasons is that he acknowledges Mrs Tymoshenko as his main political opponent and he does not want to see her free as she is the only politician who could beat him."
Yanukovich was also offended when he found out Kiev would not be offered a firm prospect of full membership of the EU; he felt Ukraine was being treated as a lesser country to "even Poland", with which it shares a border.
"Many citizens have got it wrong on European integration. It is not about membership, we are apparently not Poland, apparently we are not on a level with Poland ... they are not letting us in really, we will be standing at the doors. We're nice but we're not Poles," Oliynyk said.
Poland became a full member of the EU in 2004. EU enlargement chief Stefan Fuele suggested after Yanukovich's U-turn that perhaps the bloc should have offered Ukraine membership at some point.
Amid the acrimony, leading officials, including Mykola Azarov, Yanukovich's prime minister, performed a volte-face.
In September, just after his government had approved signing the pact with the EU, Azarov had painted a glowing future for Ukraine in Europe. "We all want clean air and water, safe food, good education for our children, up-to-date medical services, reliable legal representation, etc. All these are not abstract terms, but norms and rules that are already in place in the EU, which we need in Ukraine," he said.
But on November 21, Azarov suspended discussions with the EU in the interests of "national security" and ordered a renewal of "active dialogue" with Moscow.
EU negotiators had no time to renegotiate before a meeting in the Lithuanian capital Vilnius seven days later, where Yanukovich had been expected to sign an agreement with the EU. He failed to do so.
Last week Azarov was on the streets of Kiev explaining the change of direction to pro-Yanukovich supporters. "So-called leaders tell us fairy tales about how, once we had signed, we would be able to travel to Europe without visas. Nothing of the sort. To get that we would have to fulfil a whole raft of conditions," he said.
A HEAVY PRICE
Yanukovich knew there would be a cost, whichever way he turned. Spurning Putin would likely bring economic damage; spurning the EU has brought political damage.
Yanukovich will resist for as long as possible signing up to Putin's customs union, say analysts; but the prospect of Ukraine joining has already fired up mass protests in Kiev calling for him to resign. It has also split his inner circle.
Yanukovich has become increasingly isolated, spending more time at his estate of Mezhyhirya, 16 km (9 miles) north of Kiev, complete with lake and nearby forests where he likes to hunt. There he is guarded by a large contingent of police, who allow in only family members and his closest aides.
Bohoslovska, who quit Yanukovich's party last month after more than four years of membership, said some of his oldest friends, business leaders and consultants no longer felt they could tell him the truth.
"His old friends, who have known him his whole life, I have spoken to them and they say that when they tell him the truth, he doesn't talk to them for a few months," she told Reuters. "In recent years, Yanukovich created a system around him by which he doesn't have to hear what he doesn't like."
At the same time, two advisers with stronger ties to Moscow than others have grown influential. Andriy Kluyev, secretary of the National Security and Defence Council, and Viktor Medvedchuk, who has no formal role in government, are called Putin's emissaries by opposition leaders and Yanukovich allies alike.
Both have business interests in Russia. Kluyev arranged the purchase by Russians of Prominvestbank, a private bank in Ukraine, and Putin is godfather to one of Medvedchuk's children, sources close to both men say. Both helped on Yanukovich's 2004 and 2010 election campaigns.
"Kluyev is the direct agent of Putin's influence in Ukraine. He is a big friend of Medvedchuk, who has family ties with Putin," Bohoslovska said.
Kremlin spokesman Dmitry Peskov said the Russian leader and Medvedchuk "know each other well" and have "very good relations," but declined to comment on whether Medvedchuk and Kluyev were advocates of Putin's interests in Ukraine.
Sources close to Kluyev and Medvedchuk said they were committed to supporting Ukraine's interests.
It is clear that Yanukovich's more liberal advisers are weaker than before the protests, or even out to distance themselves from him. His chief of staff, Serhiy Lyovochkin, offered to resign on November 30 over the violence meted out against protesters, but Yanukovich said no. Lyovchkin declined to comment.
Two senior members of the Party of Regions have already quit; and more than a dozen others remain on board only through fear that their businesses will be raided if they fail to support Yanukovich, according to a businessman who asked not to be named.
For Yanukovich, it's a daunting balancing act. His best hope may be to portray his sudden reversal of strategy as a masterstroke of negotiation - pulling EU and U.S. officials back to the table and forcing them to reconsider what they can offer.
"Ukraine is at a crossroads and there's a huge boulder there. We go one way to Russia and we get hit. We go the other way, to Europe, and we get hit. We standstill, and we get hit," Oliynyk said, drawing a diagram on a notebook.
"But it will hurt less this way," he said, pointing in the European direction.