Ukrainian President Petro Poroshenko, left, participates in a media conference with European Commission President Jean-Claude Juncker at E.U. headquarters in Brussels on Thursday, Aug. 27, 2015. (Virginia Mayo/AP)

Ukraine’s main creditors agreed Thursday to forgive a portion of the nation’s debt, lightening the war-burdened country’s economic problems and unlocking additional international assistance.

The deal would write off 20 percent of the value of bonds held by Ukraine’s private creditors, giving the nation crucial breathing space as conflict continues to rage with Russian-backed rebels in the eastern part of the country. The agreement is a milestone in Ukraine’s attempts to get its flailing economy back on track 18 months after protesters overthrew President Viktor Yanukovych.

The announcement caps months in which Ukraine’s economy has started to recover after appearing deeply imperiled in the late winter, when the nation’s currency plunged and the country nearly ran out of cash.

Since then, the currency has stabilized, the economy’s contraction has slowed, and policymakers and analysts are more optimistic. A free-trade agreement with the European Union is expected to take effect Jan. 1, offering further opportunities for Ukraine in the world’s largest single market. Ukraine’s economy is still forecast to shrink up to 9 percent this year, among the most wrenching economic contractions in the world.

“The default expected by our enemies will not happen,” Ukrainian Prime Minister Arseniy Yatsenyuk told his cabinet Thursday, his office said. “Ukraine has reached an agreement with its creditors committee on the restructuring and write-down of our debt.”

Ukrainian Prime Minister Arseny Yatseniuk chairs a government meeting in Kiev, Aug. 27, 2015. Ukraine will not offer a better debt deal to Russia than to other creditors, Yatseniuk said on Thursday, after the country reached a restructuring agreement on $18 billion of its debt. REUTERS/Valentyn Ogirenko (Valentyn Ogirenko/Reuters)

Ukraine’s creditors agreed to forgive just under $4 billion of what they were owed, he said.

Ukraine was struggling economically even before Yanukovych was ousted in February 2014, and the pro-Moscow president had taken a $3 billion loan from Russia months before he left power. Thursday’s deal does not address that repayment, due in December. Russian Finance Minister Anton Siluanov said Thursday that Russia will continue to insist that the loan be repaid in full.

Ukrainian leaders have indicated that they are offering the same reduced payment terms to Russia but that they do not plan to repay the money in full, because doing so would throw off the terms of their international bailout. Many in Ukraine also consider Russia the aggressor in the ongoing conflict, after the Kremlin annexed Ukraine’s Crimean Peninsula, then threw its weight behind rebels in the east.

Private creditors, led by U.S. mutual fund Franklin Templeton Investments, agreed to write off a portion of their debts after months of grinding negotiations. Ukrainian Finance Minister Natalie Jaresko had threatened to impose a moratorium on paying down the debts, a step that would have conserved the country’s cash but made it an international financial pariah.

The agreement will enable Kiev to receive desperately needed international financial assistance, the Finance Ministry said.

The International Monetary Fund had pushed for Ukraine to reduce its debts to $15 billion in the coming years to make its economic load more sustainable. The deal meets those demands, a Finance Ministry spokeswoman said, unlocking the remainder of a $25 billion bailout from the IMF, the United States and Europe.

Under the terms of the deal, Ukraine would be spared the full burden of debt payments if its economic growth remains under 3 percent, but it would pay more if the economy expands more robustly. Ukraine agreed to pay a slightly higher interest rate of 7.75 percent overall.

The deal still needs to be approved by Ukraine’s parliament and by a formal meeting of Ukraine’s creditors.

But it received an enthusiastic endorsement from E.U. leaders who were meeting with Ukrainian President Petro Poroshenko in Brussels on Thursday. IMF Managing Director Christine Lagarde also signed off on the deal.

“The agreement will help restore debt sustainability,” Lagarde said in a statement. “I am very pleased with today’s announcement.”

The deal also drew praise from the Obama administration.

“This agreement will help to improve Ukraine’s public finances, provide the authorities with breathing room to execute their ambitious reform agenda, and strengthen the groundwork for economic recovery and private-sector-led growth,” Treasury Secretary Jack Lew said.

Poroshenko said Ukraine will use the deal to bolster economic growth. He was in Brussels to discuss a wide range of issues that included the conflict in eastern Ukraine, where fighting continues to kill several people every day. A cease-fire that went into effect in February has not stopped the violence.

Despite Thursday’s deal, arduous tasks remain for Ukraine as it tries to restore economic growth. The country remains the most corrupt in Europe, according to Transparency International rankings, and analysts and diplomats say progress in combating that menace has been slow.

The country is revamping its police force, long considered one of the worst institutions for petty day-to-day bribe-taking. And former Georgian president Mikheil Saakashvili has taken the reins of Odessa province in an unusual arrangement that Western diplomats say is a test case for whether Ukraine is capable of making progress against corruption.

Ukrainian leaders have promised a new slate of anti-corruption measures in the coming weeks.

Read more:

Ukraine topples Communist statues but raises a bigger debate

Former president of Georgia seeks to free Ukraine from Moscow’s orbit

Ukraine’s economy choking under Russian pressure, but Western help is scarce