Russia and Ukraine signed a deal Monday that restores natural gas shipments to Ukraine and paves the way for an end to the nearly two-week cutoff of most Russian gas to a freezing Europe.

The agreement was signed by the heads of Russia's state-run natural gas monopoly Gazprom and the Ukraine's gas company Naftogaz. The signing was witnessed by Russian Prime Minister Vladimir Putin and Ukrainian counterpart Yulia Tymoshenko.

Putin said Gazprom had received orders to resume shipments bound for Europe, which had been cut since Jan. 7 as Moscow and Kiev argued over 2009 gas prices and allegations that Ukraine was stealing gas destined for Europe.

Click to view photos.

Ukraine disputed this, claiming that Russia was not sending enough "technical gas" to push the rest further west.

Officials say the restored gas shipments could take up to 36 hours to cross Ukraine and reach European customers.

Europe gets about 20 percent of its total gas needs from Russia via Ukrainian pipelines, and the cutoff hit hard at some countries, such as Bulgaria and Slovakia, that rely almost entirely on Russia for gas.

The confrontation has deeply shaken Europeans' trust in both Russia and Ukraine as reliable energy suppliers, as more than 15 nations have been forced to scramble for alternative sources of energy. The dispute was further complicated by geopolitical struggles over Ukraine's future and over lucrative export routes for the energy riches of the former Soviet Union.

Tymoshenko and Putin negotiated a preliminary deal for Ukraine to get gas with a 20 percent discount from this year's average European price, which Russia says is $450 per 1,000 cubic meters. That would double the price 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 midsummer, Ukraine could be paying as little as $150 for 1,000 cubic meters, said Ronald Smith, a strategist at Moscow's Alfa Bank.

Ukrainian Parliament Speaker Volodymyr Lytvyn said Monday, citing Naftogaz and Russian officials, that the average price Ukraine will pay this year will be around $240 to $250. He did not elaborate.

Russia won a key principle, however, that Ukraine must pay more for its energy supplies. Russia also won't have to pay higher transit prices to Ukraine to use its pipelines.

Putin said in 2010, Ukraine will have to pay full price for Russian gas, and Russia will pay market prices for transit.

In the long term, it is not clear how Ukraine will pay for the huge amount of Russian gas needed to run its outdated factories and heating systems.

Ukrainian opposition leader Viktor Yanukovych said any gas price higher than $250 would be mean a "collapse" of the economy, which is already coping with a collapse of the national currency, a drastic fall in exports and a shaken banking sector.