Russia and Ukraine struck an "agreement in principle" on Thursday to continue the transit of Russian gas through Ukrainian territory.
European Commission Vice President Maros Sefcovic announced the news in Berlin, days before the deal was due to expire at the end of 2019.
"After these very intensive talks I am very glad to say that we reached an agreement in principle on all key elements," Sefcovic said, adding that more details about the agreement would be discussed Friday.
According to the European Union (EU) official, the agreement covered "all key elements" and said it is "very good and very positive news for Europe, for Russia, for Ukraine, for gas markets, and for citizens in all countries."
A number of EU member states rely on the natural gas delivered through Ukraine from Russia, which has often been interrupted due to disputes.
"We really have worked well today, we've prepared a detailed protocol," Russian Energy Minister Alexander Novak said. "I hope we can soon come to permanent arrangements."
Earlier today, Russian President Vladimir Putin said at a press conference televised by local media that Moscow wants to maintain natural gas transit through Ukraine after two new pipelines are put into action.
"Despite the construction of new infrastructure projects such as Nord Stream, Nord Stream 2 and TurkStream, we will maintain transit via Ukraine," the Russian leader said.
The deal is particularly critical for Ukraine for its own supply of gas across several parts of the country.
Kyiv had sought a long-term deal that would also ensure such supplies.
"Ukraine's priority is to sign a long-term agreement with definite gas transport volumes, to ensure stability on European energy markets and lower prices for end consumers," Ukraine's Energy Ministry said in a statement this week.
Russia was reportedly seeking only a short-term deal.
Tensions between Kyiv and Moscow escalated in recent years after Russia's annexation of Ukraine's Crimea Peninsula in 2014 as well as its backing of separatists in eastern Ukraine.