A dispute between Russia and Ukraine in January cut supplies to Europe
The EU and international lending institutions have agreed a deal with Ukraine to help it provide stable supplies of Russian gas to Europe.
Loans worth $1.7bn (£1bn) were agreed in return for reforms to Ukraine's gas sector, the European Commission said.
The deal is meant to include money to help Ukrainian national gas company Naftogaz pay off large debts to Russia.
In January, many countries were left without gas because of a payment dispute between Moscow and Kiev.
The new deal will allow Ukraine to replenish its reserves of Russian gas before the winter.
Commission President Jose Manuel Barroso said Ukraine had made commitments which would ensure increased transparency and the long-term viability of the industry, though he did not give details.
"The agreement should provide the stability needed to significantly reduce the risk of a further gas crisis between Ukraine and Russia and therefore provide the security of supply that member states and our consumers expect," he said.
The institutions that will provide funding include the International Monetary Fund, the World Bank, and the European Bank for Reconstruction and Development.
Lenders have called for Naftogaz to end subsidies of gas supplies within Ukraine as a condition for making loans, correspondents say.
Russia provides about a quarter of the gas consumed in the EU and 80% of that is piped through Ukraine.