Ukraine and Moldova have both been granted EU candidate status, European Council president Charles Michel has announced.
"Today marks a crucial step on your path towards the EU," Michel said, describing the European Council's decision as a "historic moment".
Ukraine applied days after the Russian invasion in February and the process moved at a record speed.
Its president, Volodymyr Zelensky, hailed Thursday's decision.
"It's a unique and historical moment in UA[Ukraine]-EU relations..." he tweeted. "Ukraine's future is within the EU."
The mayor of the Ukrainian capital Kyiv, former boxer Vitali Klitschko, paid an emotional tribute to his fellow citizens resisting the invasion.
"We paid a very high price for this chance," he wrote on Telegram. "Yes, we still have a lot to do on the way to the European family.
"But I am sure that Ukraine will do everything necessary, fulfil all the conditions and pass the necessary laws. Because otherwise our state has no future. Indeed, our best defenders are dying for it."
Candidate status is the first official step towards EU membership. But it can take many years to join and there's no guarantee of success.
'Why should we wait?'
The European Commission president said the accession process would be "merit-based" and "by the book", and that formal negotiations would not begin until conditional reforms were carried out. These included bolstering the rule of law and fighting corruption. The commission is due to take stock at the end of 2022.
The step is undoubtedly a big moment for Ukraine and a popular one.
While Moldova's application was accepted, a third former Soviet state, Georgia, has still to qualify for candidacy.
Michel said that the council recognised the country's "European perspective" and was "ready to grant candidate status once the outstanding priorities are addressed".
Georgian President Salome Zourabichvili tweeted that her country was "ready to work with determination over the next months to reach the candidate status".
European Commission President Ursula von der Leyen said all three countries were "part of our European family".
"This decision strengthens us all," she tweeted.
"It strengthens Ukraine, Moldova and Georgia, in the face of Russian imperialism. And it strengthens the EU. Because it shows once again to the world that we are united and strong in the face of external threats."
President Zelensky spoke of his country's desire for candidate status in almost every speech over the past week. He knows that starting down the path of EU membership will permanently shift Ukraine out of Russia's sphere of influence.
Lithuanian President Gitanas Nauseda told reporters the EU's political backing was very important for Ukrainians: "This is the least we can provide for them."
Outside the summit building, activist Anna Melenchuk from Kyiv told the BBC: "People I know are dying every day at the hands of Russian soldiers. This is why it's so important to have the European Union's support."
It was pro-EU protests that ousted Ukraine's Russia-backed President Viktor Yanukovych in February 2014.
That event in turn led to the annexation of Crimea and the separatist uprisings, the events that Ukrainians see as the start of the current war.
How will Russia react?
The Kremlin knew this was on the cards and has already been acting as if it's no big deal.
Last week in St Petersburg, President Vladimir Putin claimed he had "nothing against" Ukraine's possible membership of the European Union: "It's their sovereign decision to join economic unions or not."
He said it, but did he mean it? It is hard to believe Russia's president would sit back and watch the country he invaded join the European Union.
President Putin once described Russians and Ukrainians as "one people, a single whole" and views Ukraine as a territory that, historically, belongs to Russia. The Russian invasion is widely seen as his attempt to force Ukraine back into Moscow's orbit, and he shows no sign of ending the offensive.
EU candidate status for Ukraine sends a strong message to Moscow: that neither Kyiv nor Brussels accepts the Putin vision of a new European order.
But he will be aware that the road from candidate status to EU member is a long one. Along the way Ukraine will face plenty of hurdles - quite likely many put there by Russia.
Balkan frustration
The long process of joining the EU frustrated Western Balkan leaders at a separate Brussels summit on Thursday.
Albanian Prime Minister Edi Rama warned Kyiv to be under no illusions: "North Macedonia is a candidate [for] 17 years if I have not lost count, Albania eight, so welcome to Ukraine."
North Macedonian Prime Minister Dimitar Kovacevski expressed his "dissatisfaction" at the lack of progress in their own bids to join the EU.
Bulgaria is effectively blocking North Macedonia and Albania's membership bids while other countries have yet to make the necessary reforms.
Some EU diplomats have previously voiced concerns that giving Ukraine candidate status could offer false hope.
French President Emmanuel Macron said in May that the prospect of membership was decades away and the Nato secretary general has warned the conflict could last years.
"We do not accept the idea of the queue," Ukraine's EU envoy told the BBC, pointing to work carried out since the EU and Ukraine signed an association agreement in 2014.
-BBC