All 27 countries of the European Union have agreed on a €50 billion ($54 billion) financial aid package to Ukraine despite staunch objections from Hungary in December and in the days leading up to Thursday’s summit in Brussels, according to a top E.U. official.

"We have a deal. Unity," European Council President Charles Michel wrote in a post on X. "All 27 leaders agreed on an additional 50 billion euro support package for Ukraine within the EU budget."

"This locks in steadfast, long-term, predictable funding for Ukraine. EU is taking leadership and responsibility in support for Ukraine; we know what is at stake."

Viktor Orban talking

Hungarian Prime Minister Viktor Mihaly Orban (Front) talks with Slovak Prime Minister Robert Fico (Back) prior to the start of an EU Summit in the Europa building on Feb. 2, 2024 in Brussels, Belgium. (Thierry Monasse/Getty Images)

ZELENSKYY'S RETURN TO DC FOR MORE CASH IN UKRAINE WAR A 'MOST DISGRACEFUL CHARADE': JD VANCE

Hungarian Prime Minister Viktor Orbán had blocked the deal in December, just days after Ukrainian President Volodymyr Zelenskyy had come to the U.S. and failed to persuade lawmakers to approve an additional $61 billion for the war-torn country.

Orbán, who has a history of banking on clashes with other EU leaders for an electoral benefit at home, told state radio at the time that he blocked the aid package to Ukraine as part of a multi-year plan to make sure Hungary gets the funds it wants from the EU budget. The 26 other leaders had agreed to the package and to make Ukraine a candidate for EU membership, which Orbán reluctantly accepted.

It is unclear what concessions, if any, were made to secure the Hungarian leaders' vote. The financial package is part of a review of the EU’s continuing seven-year budget, which must be approved unanimously.

Earlier this week, Orbán had accused the E.U. of blackmail after a leaked document reportedly suggested that the bloc planned to sabotage Budapest’s economy, by cutting off all funding to the country.

President Biden Welcomes Ukrainian President Zelensky To The White House

Ukrainian President Volodymyr Zelensky, left, walks with President Joe Biden, right. (Evan Vucci-Pool/Getty Images)

RUMORS THAT UKRAINE'S TOP COMMANDER MAY BE DISMISSED EXPOSE RIFTS IN UKRAINE TOP BRASS

European leaders argue that a Russian victory in the war would threaten the security of the bloc. The war, which was sparked by a Russian invasion nearly two years ago, has dragged on and Ukraine has been in desperate need of cash to prop up its forces. 

Russia intended for its invasion to last only a few weeks, but Ukraine’s surprising and effective resistance dragged the conflict out as it neared a third year.

Ukraine’s much-promised counteroffensive in the second year, however, did not yield the results that Ukrainian President Volodymyr Zelenskyy had promised, which has prompted questions from Congress about pouring more money into the war effort. 

President Biden has pressed Congress to embrace a bipartisan Senate deal to pair border enforcement measures with Ukraine aid.

Kharkiv, Ukraine damage during war

An apartment building damaged in a Russian rocket attack is seen in Kharkiv, Ukraine, in the early hours of Jan. 17. (Kharkiv Regional Administration/AP)

CLICK HERE TO GET THE FOX NEWS APP

Zelenskyy acknowledged the E.U. deal on X on Thursday, thanking the EU leaders for coming to an agreement. 

"Grateful to @CharlesMichel [President of the European Council]and EU leaders for establishing the €50 billion Ukraine Facility for 2024-2027." 

"It is very important that the decision was made by all 27 leaders, which once again proves strong EU unity. Continued EU financial support for Ukraine will strengthen long-term economic and financial stability, which is no less important than military assistance and sanctions pressure on Russia."

Reuters and The Associated Press contributed to this report.