Finland becomes the 31st member of NATO on Tuesday, in a historic shift that drew an angry warning of "countermeasures" from the Kremlin.

Moscow's all-out invasion of Ukraine last year upended Europe's security landscape and prompted Finland -- and its neighbour Sweden -- to drop decades of military non-alignment.

"Not so many years ago we thought it was unthinkable that Finland would become a member. Now they will be a fully-fledged member of our alliance and that is truly historic," NATO Secretary-General Jens Stoltenberg said.

"We are removing the room for miscalculation in Moscow about NATO's readiness to protect Finland, and that makes Finland safer."

Finnish Defence Minister Antti Kaikkonen called it "a win-win situation" ahead of the choreographed final formalities before Finland's blue-and-white flag can be hoisted in front of NATO's headquarters.

But Moscow decried the move as as an "assault" on Russia's security and national interests.

"This forces us to take countermeasures ... in tactical and strategic terms," Kremlin spokesman Dmitry Peskov said.

Joining NATO places Finland under the alliance's Article Five, the collective defence pledge that an attack on one member "shall be considered an attack against them all".

This was the guarantee Finnish leaders decided they needed as they watched Russian President Vladimir Putin's devastating assault on Ukraine.

"I'm 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," US Secretary of State Antony Blinken said.

- Powerful military -

Invaded by its giant neighbour, the Soviet Union, in 1939, Finland -- which has a 1,300-kilometre (800 mile) border with Russia -- stayed out of NATO throughout the Cold War.

Now its membership brings a potent military into the alliance with a wartime strength of 280,000 and one of Europe's largest artillery arsenals.

Its strategic location bolsters NATO's defences on a border running from the vulnerable Baltic states to the increasingly competitive Arctic.

Senior NATO military commander Admiral Rob Bauer told AFP that Finland had so far not requested its new allies station troops on its soil.

NATO officials say the war in Ukraine has sapped Moscow's forces, but the alliance is monitoring how Russia responds to gauge its future steps.

Awkward allies Turkey and Hungary, for different reasons of their own, delayed Finland's bid to come under the NATO umbrella -- and Stockholm's progress remains blocked.

But last week, the Turkish parliament voted to clear Finland's final hurdle.

Completing the ratification in well under a year still makes this the fastest membership process in the alliance's recent history.

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.

- Sweden soon? -

Finland's arrival nevertheless remains a bittersweet moment for the alliance as the hope had been for Sweden to come on board at the same time.

Budapest and Ankara remain the holdouts after belatedly agreeing to wave through Helsinki's bid.

Sweden has upset Hungary's leader Viktor Orban -- one of Putin's closest allies in Europe -- by expressing alarm over the rule of law in Hungary.

It has also angered Turkey by refusing to extradite dozens of suspects that President Recep Tayyip Erdogan links to a failed 2016 coup attempt and a decades-long Kurdish independence struggle.

NATO diplomats hope Erdogan will become more amenable if he weathers elections next month and that Sweden will join before a NATO summit in Vilnius this July.

Ukraine is also pushing for eventual NATO membership, but Western diplomats say that still remains a distant prospect.

"There is no better strategic solution to ensuring strategic security in the Euro Atlantic region than the membership of Ukraine in the alliance," Ukraine's Foreign Minister Dmytro Kuleba said.

NATO members in the meantime insist they are focused on providing Ukraine with the weaponry and support it needs to win the war with Russia.