Finland said it would apply to join NATO "without delay", with Sweden expected to follow, as Russia's invasion of Ukraine looked set to bring about the very expansion of the Western military alliance that Vladimir Putin aimed to prevent.
The decision by the two Nordic countries to abandon the neutrality they maintained throughout the Cold War would be one of the biggest shifts in European security in decades. Moscow called Finland's announcement a direct threat to Russia, and threatened retaliation, including unspecified "military technical" measures.
It came even as Russia's war in Ukraine was suffering another big setback, with Ukrainian forces driving Russian troops out of the region around the second largest city Kharkiv, the fastest Ukrainian advance since forcing Russia to withdraw from the capital and northeast more than a month ago.
In Geneva, the UN Human Rights Council passed a resolution to set up an investigation into possible war crimes by Russian troops in the Kyiv area and beyond before they were driven out at the end of March, a move that Russia said amounted to political score-settling.
UN High Commissioner for Human Rights Michelle Bachelet said there were many examples of possible war crimes, including unlawful killings and summary executions.
Moscow denies deliberately attacking civilians.
NATO Secretary-General Jens Stoltenberg said the Finns would be "warmly welcomed" and promised a "smooth and swift" accession process. French President Emmanuel Macron said he fully supported Finland's choice to join the alliance.
Finland's 1,300-km border will more than double the length of the frontier between the US-led alliance and Russia, putting NATO guards a few hours' drive from the northern outskirts of St Petersburg.
"Finland must apply for NATO membership without delay," President Sauli Niinisto and Prime Minister Sanna Marin said in a joint statement.
Asked whether Finland's accession posed a direct threat to Russia, Kremlin spokesman Dmitry Peskov said: "Definitely. NATO expansion does not make our continent more stable and secure.
"This cannot fail to arouse our regret, and is a reason for corresponding symmetrical responses on our side," Mr Peskov added.
Russia's foreign ministry said Moscow would be forced to take "retaliatory steps, both of a military-technical and other nature", giving no further details. Russian officials have spoken in the past about potential measures including stationing nuclear-armed missiles on the Baltic Sea.
'You caused this'
Asked on Wednesday if Finland would provoke Russia by joining NATO, Niinisto said: "My response would be that you caused this. Look at the mirror."
Five diplomats and officials told Reuters that NATO allies expect both countries to be granted membership quickly, paving the way for an increased troop presence in the Nordic region to defend them during a one-year ratification period.
Mr Putin, Russia's president, cited NATO's potential expansion as one of the main reasons he launched a "special military operation" in Ukraine in February.
NATO describes itself as a defensive alliance, built around a treaty declaring that an attack on one member is an attack on all, granting US allies the protection of Washington's superpower might including its nuclear arsenal.
Moscow regards that as a threat to its security. But Mr Putin's decision to invade Ukraine has changed Nordic public opinion, with many now embracing the view that Russia is a menace.
Finland in particular has centuries of uneasy history in Russia's shadow.
Thursday also saw an intensification of disputes over Russian supplies of energy to Europe - still Moscow's biggest source of funds and Europe's biggest source of heat and power.
Moscow said it would halt gas flows to Germany through the main pipeline over Poland, while Kyiv said it would not reopen a pipeline route it shut this week unless it regains control of areas from pro-Russian fighters.
Prices for gas in Europe surged.
Growing cost of war
Ukraine has spent 245.1 billion hryvnia (A$12.1 billion) on fighting the Russian invasion, the finance minister said on Thursday, providing a glimpse into the scale of the spending on everything from buying and repairing weapons to emergency support for internally displaced people.
On the front lines, Ukraine has mounted a counter-offensive in recent days, ousting Russian forces from villages north and east of Kharkiv they had held since the start of the invasion.
Reuters journalists have confirmed that Ukraine is now in control of territory stretching to the banks of the Siverskiy Donets River, around 40 km east of Kharkiv. To the north, the Ukrainians have been pushing towards the Russian border.
A local man looks at a residential building damaged during shelling in Kharkiv, Ukraine on 12 May 2022. Source: AAP / SERGEY KOZLOV/EPA
Ukraine's general staff said the Russians were regrouping to prevent further Ukrainian advances near Kharkiv.
Russia's retreat has begun to make it possible for some residents to return to recaptured villages around Kharkiv. But areas remain littered with mines and booby traps.
The invasion has displaced more than 8 million people within Ukraine and the number of refugees who have fled the country now exceeds 6 million, UN data showed.