By Timothy Heritage and Richard Balmforth

MOSCOW/KIEV (Reuters) - Ukraine's abrupt decision to return to Mother Russia's bear hug after a flirtation with western Europe can be traced back to a secretive meeting of their two presidents two weeks ago.

The country of 46 million, squeezed between the European Union and Russia, on Thursday froze plans to sign a trade pact with the EU which would have marked a historic shift away from its former Soviet masters in Moscow.

Ukraine said on Friday the move was tactical and motivated only by economics. Russia denied using economic and political pressure to blackmail Ukraine into submission.

But Russian government sources said President Viktor Yanukovich's decision had become all but inevitable after a mysterious meeting with Russian President Vladimir Putin in Moscow on November 9 about which almost nothing has been reported.

"It turned out beautifully - like stealing the bride at the altar," an unnamed government official told the Russian business daily Vedomosti. "Everything changed after the meeting."

Another senior Russian official described the meeting to Reuters as part of intensifying bilateral contacts as the signing of the planned EU-Ukraine trade pact in the Lithuanian capital Vilnius on November 29 loomed.

At the one-on-one meeting, this person said, Putin's message to Yanukovich was clear: join Russia in a Moscow-led customs union and in return Ukraine will receive cheaper gas from Russia and escape trade sanctions.

"We made clear to him that if he signs the agreement (with the EU), he will lose a lot immediately, that we will block Russian markets for Ukrainian goods, while the gains might not be there for years to come."

But if he joins the Customs Union "he will have immediate advantages, including gas discounts," the senior Russian government official said.

Until the Moscow meeting - which Ukrainian media said went on until 5 a.m. - Yanukovich and his team had stuck, publicly at least, to their commitment to move their country out of Russia's sphere towards the brave new world of Europe.

This was despite tense negotiations, almost daily, between the EU and the Yanukovich leadership over the continued imprisonment of opposition leader Yulia Tymoshenko, whom the EU see as the victim of a political trial.

Officials said both the Russian and Ukrainian sides had agreed not to discuss the Moscow meeting publicly.

Mykola Azarov, Ukraine's dour prime minister who is not given naturally to hyperbole, waxed lyrical last September about the benefits that would come from association with the EU.

"We all want fresh air, quality water, safe food products, a good education for our children, contemporary medical service, a reliable right to justice. These are not abstracts, but norms and rules which exist already in the European Union and which we need in Ukraine," he said, announcing government approval to sign the agreement.

Undeterred as the Ukraine-EU romance blossomed, Moscow kept up niggling reminders to Ukraine of its economic clout. Russian customs officers conducted arbitrary border checks on trucks coming in from Ukraine, causing bottlenecks and economic losses.

In late October, Russian state gas monopoly Gazprom announced that Ukraine had failed to settle an outstanding gas bill for $882 million.

A Kremlin aide at an international conference in the Ukrainian resort of Yalta warned Ukraine it was heading for bankruptcy by teaming up with the EU.

Putin and Yanukovich met in the Black Sea resort of Sochi to discuss "the concern" that the future EU-Ukraine pact was causing to Russia, the Ukrainian Foreign Ministry said.

MOOD MUSIC CHANGED

But it was only after the two men met again in Moscow this month that the mood music suddenly changed in Kiev.

Oleksander Yefremov, parliamentary leader of Yanukovich's Regions Party, suddenly began to speak of the impact Ukraine's dealings with the EU would have on the economy in terms of lost trade with Russia and employment.

"Agreement should not be accepted at any price. If we don't sign association with the EU ... it won't be the end of the world. The sun won't stop coming up. But at least we'll have our self-respect, knowing that we are a state and not somebody's puppet," he said.

Yanukovich himself spoke of the huge cost that modernising Ukraine's industrial base to European standards would require.

Story continues