BRUSSELS>> Leaders of the 27 European Union countries sealed a deal Thursday to provide Ukraine with $54 billion in support for its war-ravaged economy after Hungary dropped weeks of threats to veto the measure.

European Council President Charles Michel said the agreement “locks in steadfast, long-term, predictable funding for Ukraine” and shows the EU’s determination “to support their future, to support freedom.”

The aid package — about two-thirds loans and one-third grants — is not intended to help fight off Russia. Apart from supporting the economy and paying for rebuilding, it’s also aimed at setting Ukraine up for future EU membership.

The EU has a separate plan for funding arms and ammunition.

Almost two years after Russia invaded Ukraine, the Ukrainian economy is in shambles. The first months after the 2022 invasion saw the country lose a third of its economic output to wartime destruction and occupation by Russia, which controls Ukraine’s heartland of heavy industry.

Inflation soared to 26% because the central bank had to print money to cover budget gaps. The economy rebounded somewhat last year, but Ukraine spends almost all of its tax revenue on the war. That leaves a huge deficit because other bills also must be paid, including pensions and salaries for teachers, doctors, nurses and state employees.

Political infighting in the EU and the United States has held up funding. A combined total of more than $100 billion is at stake.

Michel said the EU’s move also would send “a signal to the American taxpayers,” which could help the Biden administration in its efforts to get a Ukraine support package through Congress.

In a statement from the White House, President Joe Biden commended the EU’s “steadfast support for Ukraine as it continues to defend itself against Russian aggression and fulfill the Euro-Atlantic aspirations of its citizens.”