Turkey on Thursday became the final NATO nation to ratify Finland's membership of the US-led defence alliance in the wake of Russia's invasion of Ukraine.
Lawmakers unanimously backed the Nordic country's accession two weeks after President Recep Tayyip Erdogan publicly blessed the bid.
NATO chief Jens Stoltenberg welcomed the ratification, saying on Twitter it would "make the whole NATO family stronger and safer."
Turkey's approval leaves Finland — which has a 1,300-kilometre (800-mile) border with Russia — with only a few technical steps before it becomes the 31st member of the world's most powerful military bloc.
Officials expect the process to be completed as early as next week.
Finnish President Sauli Niinisto thanked NATO's member states for "their trust and support."
"Finland will be a strong and capable ally, committed to the security of the alliance," he said in a statement released on Twitter.
Finland and its neighbour Sweden ended decades of military nonalignment and decided to join NATO last May.
Their applications were accepted at a June alliance summit that was designed to show the Western world's desire to stand up to Russia in the face of Europe's most grave conflict since World War II.
But the bids still needed to be ratified by all the members' parliaments — a process that stalled with Turkey and Hungary.
Ample grievances
Erdogan put up stiff resistance to Sweden's candidacy because of a series of long-standing disputes.
He first signaled his more supportive stance on Finland's membership in January — a position that forced the Nordic neighbours to bow to the diplomatic pressure and break up their bids so that both applications were not delayed.
The Hungarian parliament ratified Finland's NATO membership on Monday. It was expected to approve Sweden's accession during the current session ending June 15.
But a spokesman for Hungarian Prime Minister Viktor Orban on Wednesday called on Sweden to "clear the air" and address "an ample amount of grievances" for the vote to go ahead.
Sweden has upset Orban — one of Europe's closest allies of Russian President Vladimir Putin -- by expressing alarm over the rule of law in Hungary.
It has also angered Turkey by refusing to extradite dozens of suspects that Erdogan links to a failed 2016 coup attempt and a decades-long Kurdish fight for an independent state.
Stockholm still hopes to join the alliance in time for a July summit in Vilnius.
Most analysts believe that Turkey will only vote on Sweden's candidacy after the country's May general election.
Legitimate target
NATO was created as a counterweight to the Soviet Union at the onset of the Cold War era that began immediately after the Allies defeated Nazi Germany.
The bloc has gone through waves of expansion that brought it ever closer to Russia's borders.
NATO's reach into east and south European countries that were once under Moscow's effective control infuriated the Kremlin and created growing strains in its relations with Washington.
Putin cited the threat of NATO expanding into Ukraine as one of his main reasons for launching the war 13 months ago.
But the conflict has had the opposite geopolitical effect from the one envisioned by Putin.
Ukraine is now receiving tanks and other heavy weapons from NATO members that it hopes to use in a new counteroffensive planned for the coming weeks or months.
Finland never seriously discussed NATO membership until Putin went to war.
The Kremlin at first appeared to play down the significance of the bloc reaching a new stretch of Russia's northwestern frontier.
But Russia has stepped up its diplomatic rhetoric in recent weeks.
Stockholm this week summoned the Russian ambassador after he said Sweden and Finland would become a "legitimate target" of "retaliatory measures" — including military ones — if they join NATO.
Putin last weekend also announced plans to deploy tactical nuclear weapons in neighbouring Belarus.