BRUSSELS, Feb 1 (Reuters) - European Union leaders unanimously agreed on Thursday to extend 50 billion euros ($54 billion) in new aid to Ukraine, sending a message to the United States split on whether to keep backing Kyiv in its fight against Russia's invasion.

The agreement overcomes weeks of resistance from Hungary and comes amid uncertainty over the future of U.S. aid. Kyiv relies heavily on Western support as the war, the biggest conflict in Europe since World War Two, nears its third year.

German Chancellor Olaf Scholz said he hoped the EU decision would help U.S. President Joe Biden convince Congress to follow suit.

"This ... is also a good signal towards the U.S. The American president is a good friend and ally who is working hard to win support for his demands from the Congress," Scholz said, his comments echoed by EU chiefs in Brussels.

Ukrainian President Volodymyr Zelenskiy praised the EU agreement, saying the aid would strengthen his country's long-term economic and financial stability.

Ukraine's dollar bonds gained on the news and Kyiv said it expected to receive the first tranche of 4.5 billion euros from the EU in March from a total of 50 billion euros to come from the bloc's shared budget through 2027.

"The message is clear: Russia can't count on any fatigue from the Europeans in their support to Ukraine," said French President Emmanuel Macron.

The agreement comes after weeks of wrangling with Orban, who vetoed the aid last December.

On Thursday, he said he gave the green light after receiving assurances the aid would be used sensibly and would not come from EU funds that had been earmarked for Budapest from the bloc's joint coffers.

The EU executive is withholding some 20 billion euros from Hungary over widespread accusations that Orban has damaged democracy at home during his 13 years in power.