The European Union agreed Thursday to put Ukraine on a path toward EU membership, acting with uncharacteristic speed and unity to pull the embattled country further away from Russia's influence and bind it more closely to the West.
Meeting at a summit in Brussels, leaders of the EU's 27 nations mustered the required unanimous approval to grant Ukraine candidate status. That sets in motion a process that could take years or even decades.
The EU also granted candidate status to the tiny country of Moldova, another former Soviet state that borders Ukraine.
European Commission President Ursula von der Leyen pronounced it a "good day for Europe".
Ukrainian President Volodymyr Zelenskyy tweeted his gratitude and declared: "Ukraine's future is within the EU".
Ukraine applied for membership less than a week after Moscow invaded on February 24. Thursday's decision was unusually rapid for the EU. But the war and Ukraine's request for fast-track consideration lent urgency to its cause.
To gain EU membership, countries must meet a detailed host of economic and political conditions, including a commitment to the rule of law and other democratic principles. Ukraine, among other things, will also have to curb entrenched government corruption and adopt other reforms.
The European Parliament endorsed Ukraine's bid hours before the summit started, passing a resolution that called on EU governments to "move without delay" and "live up to their historical responsibility".
"It will strengthen Ukraine, it will strengthen Europe. It is a decision for freedom and democracy and puts us on the right side of history," European Parliament President Roberta Metsola said ahead of the final announcement.
The EU's nations have been united in backing Ukraine in its fight against Russia's invasion with money and weapons, adopting unprecedented economic sanctions against the Kremlin.
EU candidate status doesn't give an automatic right to join the bloc and doesn't provide any immediate security guarantees.
Once a country gains membership, however, it is covered under an EU treaty clause that says if a member falls victim to armed aggression, the other EU countries are obligated to assist it by all the means in their power.
The main benefits of EU membership, though, are economic, since it gives access to a market of 450 million consumers with free movement of labour, goods, services and capital.
Ukraine has long aspired to join NATO, too, but the military alliance is not about to offer an invitation, in part because of governmental corruption, shortcomings in the country's defence establishment, and its contested borders.
Before the war, Russian President Vladimir Putin demanded that Ukraine never be allowed to join NATO, which he has condemned for its eastward spread toward Russia's flank.
But earlier this month, he did not seem bothered by Ukraine's determination to get closer to the EU, saying it is not a military pact and thus "we have no objections".
The membership process can be long and tortuous.
Turkey, for example, applied for membership in 1987, received candidate status in 1999, and had to wait until 2005 to start talks for actual entry. Only one of more than 30 negotiating "chapters" has been completed in the years since, and the whole process is at a standstill as a result of various disputes between the EU and Turkey.
Similarly, several Balkan countries have been seeking without success for many years to join the EU.
European officials have said that Ukraine has already adopted about 70% of the EU rules and standards, but they also have pointed to corruption and the need for deep political and economic reforms in the country.
"Considerable efforts will be needed, especially in the fight against corruption and the establishment of an effective rule of law," Belgian Prime Minister Alexander De Croo said.
"But I am convinced that it is precisely the (postwar) reconstruction of Ukraine that will provide opportunities to take important steps forward."