NATO has confirmed that Sweden and Finland will be formally invited to join the military alliance as it announced a “new strategic concept”.
It also warned Russia that it must “immediately” withdraw from Ukraine, condemning the conflict in the “strongest possible terms”.
It added that Moscow’s invasion of its neighbour “gravely undermines international security and stability” and is a “blatant violation of international law”.
“Ukraine can count on us for as long as it takes,” Secretary General Jens Stoltenberg said.
Ukraine’s foreign minister, Dmytro Kuleba, said NATO had proved it could take “difficult but essential decisions”.
Leaders from the 30 members have been meeting in Madrid to discuss the war, support for Kyiv, and how to combat Russian President Vladimir Putin.
In a lengthy declaration, they said: “Today, we have decided to invite Finland and Sweden to become members of NATO, and agreed to sign the accession protocols.
“We welcome the conclusion of the trilateral memorandum between Turkey, Finland, and Sweden to that effect.
“The accession of Finland and Sweden will make them safer, NATO stronger, and the Euro-Atlantic area more secure.
“The security of Finland and Sweden is of direct importance to the Alliance, including during the accession process.”
A senior US official said Turkey, which had initially objected to the two countries joining, did not ask for anything as part of its acquiescence, Reuters reported.
Setting out a blueprint for threats and challenges, NATO promised to “defend every inch” of its territory as it outlined a “deterrence and defence posture” based on a mix of “nuclear, conventional and missile defence capabilities”.
Beyond Russia, its newly published Strategic Concept described China as a challenge to “our interests, security, and values”, and said Beijing “strives to subvert the rules-based international order, including in the space, cyber and maritime domains”.
Mr Stoltenberg said the new concept represented “fundamental shifts in our defence”.
It is the “first time since the Cold War” that such plans have been in force, he added.
He also said allies had agreed to increase NATO’s common funding.
Among the announcements are plans to:
• Strengthen forward defences
• Enhance presence on the eastern flank
• Increase the number of high-readiness forces to well over 300,000
• Boost ability to reinforce any ally
• Strengthen command and control
Ukrainian leader President Volodymyr Zelenskyy has hailed the summit as “crucial and groundbreaking” and said: “Today is really the beginning of a new history.
“In a time of (an) extremely aggressive Kremlin, the world needs an extremely bold alliance,” he added.
But Mr Zelenskyy warned: “You are now adopting the strategy of the alliance – and this is first and foremost a strategy for the security of your societies, your states. Strategy for 10 years.
“A hundred and twenty-six days of full-scale invasion of Ukraine; cruise missiles, torture, children murdered, women raped… We do not have 10 years. Do you have them? Are you really sure about that?”
He went on: “While democracies were calling on the Russian leadership to have reason and morality, Russia was accumulating power and missiles. You, the democratic leaders have urged it to respect international law, but tyrants understand force and force only.”
Mr Zelenskyy said he looked forward to a common victory, but said other states could be fired on by Russia, and if that happened it would be “our common failure”.
Speaking about Russian aggression, he went on: “It does not want to stop in Donbas or somewhere in the south of Ukraine. It wants to absorb city after city, all of us, and then all in Europe, whom the Russian leadership considers its property, not independent states. This is Russia’s real goal.
“The question is – who is next for it? Moldova? Or the Baltic countries? Or Poland? The answer is – all of them.”