The concession on the Black Sea fleet was the clearest sign yet of a marked foreign policy shift by Kiev towards Moscow under newly elected President Viktor Yanukovich, and it was immediately portrayed as a sell-out of sovereignty by opponents.
"Our Ukrainian partners will receive a discount in the price of gas," Russian President Dmitry Medvedev said at a joint news conference with Yanukovich after the two men had held talks in the eastern Ukrainian city of Kharkiv.
As a result, Ukraine would benefit from savings which could be spent on domestic economic needs, Medvedev said.
Medvedev made a direct "technical" link between the new gas terms and the extension of the stay of the Black Sea fleet for 25 years beyond 2017 - the date when it is due to leave under the existing agreement.
Its continued presence in the Crimean port of Sevastopol would provide "a greater, better guarantee for European security in the Black Sea basin," Medvedev declared.
Yanukovich has been trying to live down an old accusation that he is a pro-Moscow lackey since winning a bitterly fought election in February. The pro-western Viktor Yushchenko, whom Yanukovich succeeded, regarded the departure of the fleet in 2017 as vital for Ukrainian sovereignty.
Former Prime Minister Yulia Tymoshenko, Yanukovich's rival for the presidency, said the extension "crudely violates the 17th article of the constitution, which prohibits the stay of foreign military bases on the territory of Ukraine".
One deputy of Yushchenko's Our Ukraine party said it amounted to "a surrender of national interests".
The foreign ministry, in a statement that clearly foresaw criticism too in the West, said: "We do not regard the Black Sea fleet as a source of threat to Ukraine's sovereignty and territorial integrity. Its presence should not cause concern among our Western partners for the independence of Ukraine."
Medvedev, referring to the complicated calculation by which gas for Ukraine is priced, said Russia would give Ukraine a $100 discount on gas if the formula price was higher than $330 thousand cubic metres (tcm), or 30% if the price was lower than that.
Gazprom later explained the deal meant the discount would be 30% of the formula price, but not more than $100.
The new Ukrainian leadership needs a lower price for its huge gas imports from Russia to nail down the detail of a 2010 draft budget and secure a $12 billion credit line from the International Monetary Fund.
Yanukovich said the gas agreement was "unprecedented in the history of our relations" and Ukraine would undertake to import 30 billion cubic metres of gas by the end of 2010, rising to 40 billion in 2011.
The European Union has a stake in a new gas deal between Ukraine and Russia since it receives a fifth of its gas from Russia via Ukraine's pipeline network.
Fresh credit from the IMF is regarded by the new Yanukovich administration as vital for helping the economy recover from the global downturn, which battered its main export industries, and to restore investor confidence.
"Today's gas price deal is set to accelerate approval of the 2010 state budget and facilitate the government's ongoing talks with the IMF," said Andrey Bespyatov of Dragon Capital brokerage.
Medvedev and Yanukovich spoke of turning a new page after five years of frosty relations under the pro-NATO Yushchenko.
Under the present gas agreement, the ex-Soviet republic would pay an average of $334 per tcm for its gas this year, which the Ukrainian government said would have a disastrous effect on the economy.
The current 10-year agreement was signed early in 2009 by the Tymoshenko government, which the Yanukovich administration has accused of leading the economy to ruin.
A pricing dispute between the two countries preceding the 2009 agreement left EU customers without gas for nearly three midwinter weeks.
(EurActiv with Reuters.)