By Richard Balmforth and Pavel Polityuk
KIEV (Reuters) - Ukrainian President Viktor Yanukovich met Russia's Vladimir Putin on Friday to lay the grounds for a new "strategic partnership" to shore up Ukraine's creaking economy in defiance of protesters back home enraged by his U-turn away from Europe.
The leaders met in the Black Sea resort of Sochi in Russia, after Yanukovich flew in for an unannounced stop on his way back from China to map out a new agreement on trade and economic cooperation, a statement on Yanukovich's official website said.
Prime Minister Mykola Azarov told journalists Yanukovich would visit Moscow at some point in the future and sign a large number of documents. "We are talking about a major agreement here," Azarov said though he gave no precise details of the outline deal.
Yanukovich faces turmoil in Kiev, where protesters are massed on Independence Square and others occupy City Hall, furious at Yanukovich for walking away last month from a landmark pact on trade and integration with the European Union. Police have threatened to crack down harshly to enforce a court order that they disperse.
Ukraine needs help to meet $17 billion in debt repayments and Russian gas bills next year.
Analysts say Yanukovich's government appears to have struck a bargain with Putin, including for supplies of cheaper Russian gas and possibly credits, in exchange for backing away from the EU deal which would have heralded a historic shift westwards.
But the Sochi talks will lend ammunition to the Ukrainian opposition, which accuses Yanukovich of betraying the national interest by turning the clock back and forging closer economic ties with Ukraine's old Soviet master.
The stand-off is taking a toll on the fragile economy. The central bank has twice been forced to support the hryvnia currency this week and the cost of insuring Ukraine's debt against default has risen further.
Ukraine's dwindling currency reserves have particularly sparked alarm among investors. Intervention to support the hryvnia, repayments to the IMF and on treasury bills pushed these reserves further down by nine percent in November to $18.8 billion, the central bank said on Friday - less than that needed to cover two and a half months of imports.
Former economy minister Arseny Yatsenyuk, one of the opposition leaders, warned of even bigger protests if Yanukovich signed any agreement with Putin on the Russian-led customs union which Moscow wants Ukraine to join.
"If Yanukovich tries to sign anything with Russia about the customs union it will lead to a bigger wave of protests," Yatsenyuk told journalists.
In Kiev, several hundred demonstrators manned a protest camp on Independence Square as the opposition pressed for the resignation of the government, the release of jailed former prime minister Yulia Tymoshenko and the prosecution of the interior minister for being behind an earlier crackdown on protesters.
Tymoshenko's daughter, Yevgenia, told reporters her mother had ended a 12-day hunger strike, launched in solidarity with the protesters, at the behest "of the square".
Opposition leaders, also including world heavweight boxing champion-turned-politician Vitaly Klitschko, urged people to turn out for another rally in central Kiev on Sunday.
A separate, smaller, group of protesters milled around in the corridors and staircases of City Hall on Friday despite the strongly worded threat from police to eject them.
"We have an evacuation plan," said a 30-year-old trader, who was part of the protesters' security staff and gave his name only as Igor. "If they come at us, we will be able to hold them long enough to be able to get the women, children and the weakest men out of the building," he said.
"We won't let them take the building back. We will resist to the end. We are not hindering anyone. The employees here are working normally," added a 22-year-old Kiev student, also called Igor.
Klitschko, who seems to be emerging as an agreed opposition candidate to take on Yanukovich in an election in 2015, warned authorities that any attempt to clear the large crowds from Independence Square would lead to a country-wide revolt.
"If the authorities try to disperse people from the (Independence) Square, then you will see rising up not 100,000 or 500,000 Ukrainians but the whole country," he declared in a statement on his party's web site.
Hundreds of thousands of demonstrators, angered at Kiev's November 21 decision to abandon the deal with the EU, poured on to the streets last Sunday after many people - a lot of them young students - were hurt in police action.
Though the government later apologized, Azarov returned to the attack on Thursday, labeling those holding public buildings like the mayor's office "nazis, extremists and criminals."
He has rejected calls for his dismissal and an opposition call for early elections. His first deputy, Serhiy Arbuzov, who appeared to say on Thursday he supported snap elections, denied this on Friday, saying his words had been "twisted".
The Ukrainian state and companies will struggle to repay the $7 billion of debt maturing next year, while doubts are growing as to how long the central bank's meager reserves can stave off a currency collapse.
"We think that default risk is being seriously under-estimated," Timothy Ash, the head of emerging markets strategy at Standard Bank, said in a note to clients.
The International Monetary Fund has suspended negotiations with Ukraine for a new bail-out program, leaving the government to hunt for economic relief elsewhere.
The crisis has exposed a gulf between Ukrainians, many from the West of the country, who hope to move rapidly into the European mainstream, and those mainly from the East who look to Moscow as a guarantor of stability.
In the city of Kharkiv, a court hearing in a new prosecution against Tymoshenko - whom many demonstrators regard as their leader - was put off again because of her non-attendance due to back trouble.
The EU considers Tymoshenko, the peasant-braided politician who co-led the "Orange Revolution" protests of 2004-5, a political prisoner and campaigned in vain for her release before Kiev broke off negotiations.
(Additional reporting by Pavel Polityuk in Kiev, Steve Gutterman in Moscow and Shadi Bushra and Carolyn Cohn in London; Writing by Richard Balmforth; and Matt Robinson; Editing by Giles Elgood)