Sweden and Finland are both joining Nato - a monumental shift for two nations with a long history of wartime neutrality and staying out of military alliances. During a Nato summit in Madrid, they overcame what is likely to be the final obstacle - objections by Turkey.
Russia strongly opposes the two states joining and has used the expansion of the West's defensive military alliance as a pretext for its war in Ukraine.
Both countries have held neutral status for years, but since Russia's invasion of Ukraine support for Nato membership has risen dramatically.
Why join now?
Vladimir Putin's actions have shattered a long-standing sense of stability in northern Europe, leaving Sweden and Finland feeling vulnerable.
Finnish ex-Prime Minister Alexander Stubb said joining the alliance was a "done deal" for his country as soon as Russian troops invaded Ukraine on 24 February.
For many Finns, events in Ukraine bring a haunting sense of familiarity. The Soviets invaded Finland in late 1939. For more than three months the Finnish army put up fierce resistance, despite being heavily outnumbered.
They avoided occupation, but ended up losing 10% of their territory.
Watching the war in Ukraine unfold was like reliving this history, said Iro Sarkka, a political scientist at the University of Helsinki. Finns were looking at their 1,340km (830 mile) border with Russia, she said, and thinking: "Could this happen to us?"
Sweden has also felt endangered in recent years, with several reported airspace violations by Russian military aircraft.
In 2014, Swedes were transfixed by reports that a Russian submarine was lurking in the shallow waters of the Stockholm archipelago.
Two years later Sweden's army returned to the small but strategically important Baltic Sea island of Gotland, after abandoning it for two decades.
What will change?
In some ways, not much. Sweden and Finland became official partners of Nato in 1994 and have since become major contributors to the alliance. They have taken part in several Nato missions since the end of the Cold War.
The two countries will for the first time have security guarantees from nuclear states under Nato's Article 5, which views an attack on one member state as an attack on all.
Historian Henrik Meinander said Finns were mentally prepared for membership, following a succession of small steps towards Nato since the fall of the Soviet Union.
In 1992, Helsinki bought 64 US combat planes. Three years later, it joined the European Union, alongside Sweden, and every Finnish government since then has reviewed the so-called Nato option. The army, which serves a population of 5.5 million, has a wartime strength of 280,000 soldiers, and 900,000 reservists in total.
Sweden took a different path in the 1990s, reducing the size of its military and changing priorities from territorial defence to peacekeeping missions around the world. But that all changed in 2014, when Russia seized and annexed Crimea from Ukraine. Conscription returned and defence spending was boosted. In 2018, every household received army pamphlets titled "if crisis or war comes" - the first time they were sent out since 1991.
Finland has already reached Nato's agreed defence spending target of 2% of GDP, and Sweden has drawn up plans to do so.
What are the risks?
Russian President Vladimir Putin believes Nato expansion is a direct threat to his country's security, so Sweden and Finland joining the alliance will be perceived as a provocation.
Russia's foreign ministry says both countries have been warned of the "consequences" of such a move. Former President Dmitry Medvedev, a close ally of the Russian leader, has warned that Nato accession may prompt Moscow to deploy nuclear weapons in Kaliningrad, the Russian exclave between Poland and Lithuania.
While not dismissing these threats, Alexander Stubb suggested a more realistic risk was of Russian cyber attacks, disinformation campaigns and occasional airspace violations.
Will Nato make Sweden and Finland safer?
There is a significant minority, at least in Sweden, who believe it will not.
Deborah Solomon, from the Swedish Peace and Arbitration Society, argued that Nato's nuclear deterrence increased tensions and risked an arms race with Russia. This complicated peace efforts, she said, and made Sweden a less safe place.
Another fear is that in joining the alliance, Sweden would lose its leading role in global nuclear disarmament efforts. Many of Sweden's Nato-sceptics look back to the period between the 1960s and '80s, when Sweden used its neutrality to position itself as an international mediator.
Joining Nato would be abandoning that dream, Ms Solomon said.
Finland's neutrality was very different. It came about as a condition of peace imposed by the Soviet Union in a 1948 "friendship agreement". It was seen as a pragmatic way of surviving and maintaining the country's independence.
If Sweden's neutrality was a matter of identity and ideology, in Finland it was a question of existence, said Henrik Meinander. Part of the reason Sweden could even afford to have a debate about Nato membership was because it used Finland and the Baltics as a "buffer zone", he said.
Finland abandoned its neutrality after the Soviet Union collapsed. It looked to the West and sought to free itself from the Soviet sphere of influence.
Iro Sarkka suggested joining Nato was seen as too big a step for Finland to take in the early 1990s, having just emerged from neutrality.
But times and perceptions of risk have changed. Now, most Finns say they are ready.
What obstacles did they face to joining?
For weeks, Sweden and Finland's applications were held up by Turkey. Any Nato enlargement must be approved by all 30 members.
The Turkish government claimed the Nordic nations were supporting what it calls terrorist organisations, including Kurdish separatists and the Gulen movement, which Turkey blames for an attempted coup in 2016.
Kurds make up 15-20% of Turkey's population, and have been persecuted by Turkish authorities for generations.
In exchange for its support, Turkey said it wanted Sweden and Finland to stop providing political, financial and "arms support" to the groups.
It also wanted them to resume selling weapons to Turkey and hand over individuals with alleged terror links.
After hours of talks at the Madrid Nato summit in late June, foreign ministers from Sweden, Finland and Turkey signed a joint security pact addressing Turkey's concerns.
Nato chief Jens Stoltenberg said Sweden had agreed to step up its work on Turkish extradition requests of suspected militants. The two Nordic nations also said they would lift their restrictions on selling weapons to Turkey, he added.
In exchange, Turkey will lift its veto on the Nordic nations joining the alliance.