Russia, Ukraine and the European Union have initialled a deal for Moscow to resume gas supplies to Ukraine over the winter after months of difficult talks overshadowed by the conflict in the eastern European country.
European Commission vice president for energy, Maros Sefcovic, told a news conference the preliminary deal, clinched late on Friday, was a "crucial step" to ensure Ukraine has gas supplies from October through to March, and that Europe receives onward deliveries.
"We just initialled a trilateral agreement for the upcoming winter," Sefcovic said after nearly six hours of talks with the Russian and Ukrainian energy ministers in Brussels.
He added that "all technical details are agreed" and the framework was set, but confirmation and formal signing of the full agreement would require separate procedures.
"I'm confident that the agreement will soon be confirmed and smoothly implemented," he said after tweeting earlier it was a "major achievement".
Ukrainian Energy Minister Volodymyr Demchyshyn told reporters "commercial conditions were acceptable" and that he expected the deal to be signed shortly.
"I'm sure we will be preparing for the heating season and start pumping gas into storage shortly," he said.
"Ukraine confirmed in this document its capacity to ensure uninterrupted transit of Russian gas to EU partners."
Russian Energy Minister Alexander Novak said: "We will spare no effort to avoid any issues, problems."
Novak said Moscow's offer included a cut of "about $20" per 1,000 cubic metres from the provisionally set price of $252.
He said the price agreed was competitive with those for gas supplied to countries neighbouring Ukraine.
Sefcovic said the European Commission, the executive arm of the 28-nation EU, would continue arranging for EU and international financing of Ukraine's winter gas purchases.
"At least $500m should be available by the end of this year," he said.
Russia and its Cold War-era satellite Ukraine have been locked in bitter dispute for years, which worsened significantly when a popular uprising ousted pro-Moscow President Viktor Yanukovych in late 2013.
As the Ukraine crisis worsened and pro-Russian rebels seized large areas of eastern Ukraine, the gas supply talks were held hostage by a conflict, which has now cost some 8,000 lives.
At the end of July, Ukraine announced it was halting all Russian gas purchases because it found the price inconsistent with what Russian energy giant Gazprom charged other European clients.
In recent weeks, however, there appears to have been an easing of tensions on the ground in eastern Ukraine with a ceasefire finally holding after months of daily breaches.
At the same time, the EU pursued contacts with both sides, mindful of the approach of winter when gas demand will rise.
In previous disputes in 2006 and 2009, Moscow cut supplies to Ukraine during the winter, sparking knock-on shortages in Europe, especially in many of the former communist eastern states which still depend on Russia for nearly all their energy needs.
The EU relies on Russia for about a third of its gas supplies, with half of that amount transiting through Ukraine.