MOSCOW - Russia and Ukraine announced a deal Sunday to end the bitter dispute that has blocked Russian natural gas from Europe for nearly two weeks and deeply shaken Europeans' trust in the two as reliable energy suppliers.

The early morning agreement between Russian Prime Minister Vladimir Putin and his Ukrainian counterpart Yulia Tymoshenko came after a day of intense negotiations.

Still, relief for millions of frustrated consumers and businesses could be days away. The deal on 2009 gas prices is not likely to be finalized until at least Monday. If Russia turns on the taps immediately after the signing, it could take another day for the gas to travel hundreds of miles across Ukrainian pipelines to eastern Europe.

Russia stopped selling gas to Ukraine for domestic use on Jan. 1 in a dispute over prices. On Jan. 7, Moscow then halted all shipments to Europe via Ukraine, alleging that Ukraine was siphoning off Europe-bound gas. Ukraine disputed this, claiming that Russia was not sending enough "technical gas" to push the rest further west.

Europe gets about 20 per cent of its total gas needs from Russia via Ukraine's sprawling pipeline network, but countries in eastern Europe like Bulgaria and Slovakia are totally dependent on Russian gas.

The conflict has been further complicated by geopolitical struggles over Ukraine's future and over lucrative export routes for the energy riches of the former Soviet Union.

Under the terms announced Sunday, Ukraine will pay 20 per cent less than the European "market price" price for gas this year, which Russia says is US$450 per 1,000 cubic metres. That's more than twice as much as the $179.50 Ukraine paid in 2008.

However, natural gas prices for Europe are expected to fall sharply later this year, due to the fall in oil prices. By mid-summer, Ukraine could be paying as little as $150 for 1,000 cubic metres, said Ronald Smith, a strategist at Moscow's Alfa Bank.

Russia has won a key principle, however, that Ukraine must pay more for its energy supplies.

Ukraine is also heavily dependent on Russian gas and it is not clear how it will pay for the huge amount needed to run its outdated factories and heating systems.

Moscow and Kiev spent the last two weeks blaming each other for the energy debacle, but amid the arguing, both countries' images were wounded.

"The best part for Russia is they get the gas to the customers. This has been pretty damaging" to Russia's reputation as a reliable energy partner, Smith said Sunday. "(Ukraine) probably lost as well, because the European Union was looking at them as a possible member and may now be wondering if it's worth the effort."

Russia also emerged without having to pay a higher gas transit price in 2009.

Putin said Sunday that Russia offered Ukraine the "20 per cent discount" on the condition that the gas transit price does not change for 2009. Beginning next Jan. 1, however, Ukraine will pay full price for gas and Russia will pay market prices for transit, he said.

Russia currently pays $1.70 to transport 1,000 cubic metres of gas 100 kilometres, which last year amounted to close to $3 billion for Ukraine. Putin says the market price is about double that.

Putin and Tymoshenko made no mention of the more than $600 million that Russia's state-run gas monopoly Gazprom claims Ukraine still owes for 2008.

Sergei Kuriyanov, a Gazprom spokesman, told state television Vesti that documents to finalize the agreement were being prepared. There was no immediate comment from Ukraine's state-run gas company Naftogaz.

The global economic crisis has hit both former Soviet republics hard.

With the dramatic fall in the price of oil -- the country's main source of revenue -- Russia is facing a budget deficit this year for the first time in a decade. Industrial production has slowed and the ruble has lost nearly 30 per cent of its value since summer.

Ukraine's economy is in even worse shape, battered by the drop in world prices for steel and heading into a painful recession.

The two neighbours have been at odds since the 2004 Orange Revolution brought Ukrainian President Viktor Yushchenko to power. His avid push for Ukraine to join NATO and the EU has angered Moscow.