European leaders have decided to open EU membership talks with Ukraine and Moldova and to grant candidate status to Georgia.
Ukraine's President Volodymyr Zelensky hailed the decision, made at a summit in Brussels, as "a victory" for his country and Europe.
A spokesperson for Charles Michel, the President of the European Council, said that agreement was unanimous.
Hungary has long opposed talks starting with Kyiv, but did not veto the move.
However, Prime Minister Viktor Orban posted a blunt message on Facebook, distancing himself from the other 26 EU leaders: "EU membership of Ukraine is a bad decision. Hungary does not want to participate in this bad decision, and therefore stayed away from the decision today."
Mr Zelensky was delighted by the EU's announcement: "This is a victory for Ukraine. A victory for all of Europe. A victory that motivates, inspires and strengthens," he said on X.
Ukraine and Moldova applied to join the EU after Russia launched its full-scale invasion of Ukraine in February 2022. They were both given candidate status last June, while Georgia was passed over at the time.
Talks on joining the European Union can take years, so Thursday's decision will not guarantee Ukraine membership.
German Chancellor Olaf Scholz praised his fellow leaders for showing a "strong sign of support", adding that it was clear that both Ukraine and Moldova belonged to "the European family".
The decision provides Ukrainians with a moment of good news, after almost 22 months of Russia's war and a continuing struggle to secure Western military and financial aid.
Mr Zelensky travelled to the US earlier this week in a vain attempt to persuade the US Congress to push through $61bn in military funding, blocked by Republican lawmakers.
Ukraine's counter-offensive against Russia's occupying force has ground to a halt at the start of winter.
Earlier on Thursday, President Vladimir Putin mocked Ukraine and claimed Western support was running out: "Excuse my vulgarity, but everything is being brought in as a freebie. But those freebies could run out at some point."