The European Union has expressed relief that a dispute threatening gas supplies from Russia is over, but said lessons must be learned from the crisis.
Russia says gas supplies to Europe have now been fully restored
Russia has agreed to start pumping gas to Ukraine again, after turning off the taps in a row over prices.
Lower gas pressure meant supplies fell to states like France, Poland and Italy, which use Ukraine's pipeline.
The EU's energy commissioner said clearly Europe needed a more "cohesive policy on security of energy supply".
Andris Piebalgs had been leading an emergency meeting of EU gas experts when news of the deal came through from Moscow.
Under the five-year agreement, Ukraine will buy Russian gas, mixed with Central Asian gas, for $95 (£54) per 1,000 cubic metres on average.
Russia halted gas supplies to Ukraine on 1 January, after Kiev rejected a price rise that would have taken the cost of gas from $50 to $230.
Austrian Energy Minister Martin Bartenstein told journalists in Brussels that Russian gas would remain the backbone of the European energy supply mix.
But he said: "We have to think about energy supply security in general, gas supply security... and we have to learn the lessons."
He added that a planned pipeline to deliver Caspian gas to Europe via Turkey could help to diversify the EU's sources of gas.
Russia supplies about a quarter of Western Europe's needs, but this proportion is due to rise dramatically in future, under current plans.
Mr Bartenstein, whose country holds the EU presidency, said energy would be a high priority of the EU's March summit.
He asked the European Commission to submit a plan for an improved energy policy, looking at security of supply, competitiveness of prices, and possible further investment in the energy sector.
Both Russia and Ukraine said they had got what they wanted from the deal.
Analysts say the agreement saves face on both sides.
However, Ukrainian Prime Minister Yuri Yekhanurov said his country had learnt that it must boost energy efficiency in order to reduce gas consumption.