The International Monetary Fund has agreed with Ukraine on a new bailout deal worth $17.5 billion that could climb to around $40 billion over the next four years with help from other lenders like Europe and the U.S.

Ukraine has so far received $4.6 billion as part of a $17 billion aid package from the IMF agreed on last year, but that program has run into trouble as the war ravaging the country's eastern region has weighed on its economic prospects.

Facing bankruptcy, Ukraine last month asked the IMF to replace its program with a new one to restore confidence in its finances.

IMF Managing Director Christine Lagarde said Thursday that "this new program offers an important opportunity for Ukraine to move its economy forward at a critical moment in the country's history."

The announcement came just before leaders of Russia, Ukraine, France and Germany emerged from marathon talks to announce a peace deal for eastern Ukraine.

The four-year package "would support immediate economic stabilization in Ukraine as well as a set of bold policy reforms aimed at restoring robust growth of the medium term and improving living standards for the Ukrainian people," Lagarde said.

Kiev has also received loans from the European Union and the United States, both of whom have recently promised more help.

Lagarde said the IMF support would be backed by other international financing. "From these various sources taken together, a total financing package of around $40 billion is estimated over the four year period," she told reporters.

"This program will require the authorities' steadfast determination to reform the economy," Lagarde underlined.

She praised Kiev's reform efforts so far, saying that the government has "not only reached their targeted deficit for this year but they have exceeded the objective and produced a better result than was expected."