Finland has become the 31st member of the Nato security alliance, doubling the length of member states' borders with Russia.
The Finnish foreign minister handed the accession document to the US secretary of state who declared Finland a member.
Then in bright sunshine in front of Nato's gleaming new headquarters, Finland's white-and-blue flag joined a circle of 30 other flags.
Finland's accession is a setback for Russia's Vladimir Putin.
He had repeatedly complained of Nato's expansion before his full-scale invasion of Ukraine.
US Secretary of State Antony Blinken said by attacking his neighbour, the Russian leader had triggered exactly what he had sought to prevent.
Kremlin spokesman Dmitry Peskov warned that Russia would be "watching closely" what happens in Finland, describing Nato's enlargement as a "violation of our security and our national interests".
A military band played Finland's national anthem followed by the Nato hymn. Beyond the perimeter fence a small group of protesters waving Ukrainian flags chanted "Ukraine in Nato", a reminder of why non-aligned Finland had asked to join along with Sweden in May 2022.
Finland shares a 1,340-km (832-mile) eastern frontier with Russia and after the war in Ukraine began Helsinki chose the protection of Nato's Article Five, which says an attack on one member is an attack on all.
In effect, it means if Finland were invaded or attacked, all Nato members - including the US - would come to its aid.
Russia's invasion prompted a surge in Finnish public opinion towards joining Nato to 80% in favour.
"It is a great day for Finland," said Finnish President Sauli Niinisto, proclaiming a new era for his country. Finland would be a reliable ally and its membership would not be a threat to anyone, he said. "Security and stability are those elements which we feel very strongly; if people can live in secure stable circumstances that's the basic element of happy life."
"This will make Finland safer and Nato stronger," said Secretary General Jens Stoltenberg earlier, describing it as a proud day for him and the alliance.
"President Putin had a declared goal of the invasion of Ukraine to get less Nato along its borders and no more membership in Europe, he's getting exactly the opposite."
US Secretary of State Antony Blinken said he was "tempted to say this is maybe the one thing we can thank Mr Putin for, because he once again here has precipitated something he claims to want to prevent by Russia's aggression".
Finland brings with it a well-equipped and trained, active armed force of about 30,000. It can also call on 250,000 reserves.
It also provides a challenge for Nato to help keep its long border with Russia secure, but it is already being included in Nato's latest defence plans to keep the alliance secure.
Sweden's application has for now become stuck, with Turkish President Recep Tayyip Erdogan accusing Stockholm of embracing Kurdish militants and allowing them to demonstrate on the streets. Hungary is also yet to approve Sweden joining.
As he handed over the accession document to Mr Blinken, Finnish Foreign Minister Pekka Haavisto said he had a very important initial task: "The task is to give to you for the deposit also our ratification for Swedish membership."
Mr Stoltenberg said the most important thing was that Sweden joined as soon as possible and the Finnish president said he looked forward to welcoming his Nordic neighbour at Nato's next summit in Lithuania in July.
Helsinki's journey to accession has lasted less than a year, and Tuesday's ceremony coincides with the 74th anniversary of Nato's founding in 1949.
"Finland's a terrific ally, very capable, shares our values and we expect a seamless transition into its proper seat at the table," US ambassador to Nato Julianne Smith told the BBC.
The Kremlin said that Russia was being forced to take counter-measures to ensure its own security, tactically and strategically, but pointed out it had never had disagreements with Helsinki in the way that Ukraine had become "anti-Russian".
Meanwhile, Defence Minister Sergei Shoigu said on Tuesday that Russia's short-range Iskander-M ballistic missile system had been handed over to Belarus and was capable of carrying nuclear as well as conventional weapons. Some Belarusian fighter jets were also capable of carrying nuclear weapons, he said.
Jens Stoltenberg said Nato had not yet seen any changes to Russia's nuclear posture that would require any change by the alliance. He added there would be no Nato troops stationed in Finland without the consent of the government in Helsinki.
Nato will now have seven members on the Baltic Sea, further isolating Russia's coastal access to St Petersburg and its small exclave of Kaliningrad.
Mr Peskov told the BBC that Russia would be watching closely how Nato used Finnish territory "in terms of basing weapons systems and infrastructure there which will be right up close to our borders, potentially threatening us".
"Based on that, measures will be taken," the Kremlin spokesman said.