Hungary's Parliament has removed the final obstacle to Sweden joining the NATO military alliance, after lawmakers voted to approve the application following a stand-off that lasted almost two years.
New members of the existing 31-country alliance must receive unanimous support from all other member states before being allowed to join, and Hungary was the last country that had not approved Sweden's membership bid.
In the end, only six lawmakers voted against the proposal out of the 194 parliamentarians who voted on the issue on Monday in Budapest.
Jens Stoltenberg, the outgoing secretary-general of NATO, welcomed Sweden's accession, saying: "Sweden's membership will make us all stronger and safer."
Sweden's Prime Minister Ulf Kristersson called it "a historic day".
Kristersson said: "The parliaments of all NATO member states have now voted in favor of Swedish accession. Sweden stands ready to shoulder its responsibility for Euro-Atlantic security."
The news was also welcomed by Germany's Chancellor Olaf Scholz, who said all NATO members would benefit from Sweden's membership.
"It is good that the Hungarian Parliament approved Sweden's accession today," he added.
Robert Dalsjo, a senior analyst at the Swedish Defense Research Agency think tank, told Reuters it was a win-win situation.
"NATO gains a member that is serious and capable, and it removes a factor of uncertainty in Northern Europe," he said. "Sweden gains security in a crowd... supported by American nuclear deterrence."
Elod Novak of the opposition party Our Homeland was one of the six MPs who voted against it.
"Let's veto Sweden's NATO accession," he said before the vote, urging the MPs to "veto the path that leads to World War III.
Monday's ratification by Hungary followed the green light from the Turkish parliament on Jan 23. Sweden will officially become the 32nd member of the alliance at its next summit in Washington DC in July.
Now Sweden's membership has been approved by Hungary's Parliament, the decision will go to Hungary's interim president, Laszlo Kover, who has five days to sign off on it, before the application will then be sent to the US State Department in Washington, which is the protocol for new members joining the alliance.
The other country to hold out over the membership of Sweden, and its neighbor Finland, the previous most-recent new member, was Turkiye, which is of huge strategic importance to NATO because of its geographical location, close to the Middle East and the Black Sea.
US media outlet CNBC reported that Turkiye has the second-largest military in NATO after the US, and that it is home to 50 US nuclear warheads. However, the country has also purchased the Russian S-400 surface-to-air mobile missile system from Moscow.
Hungary's Prime Minister Viktor Orban is one of the foreign heads of state most widely regarded as being sympathetic to Russia and its President Vladimir Putin.
Last October, Orban became the first EU leader to be pictured shaking hands with Putin since the conflict began, when the two leaders met in Beijing.
Ahead of the parliamentary vote, last week Hungary signed a deal to buy four Saab JAS Gripen fighter jets from Sweden, a sign of the improved relationship between the countries.
"We not only keep our air defense capability but will increase it," said Orban, adding that it meant his country's "commitment to NATO will strengthen and so will our participation in NATO's joint operations".
Previously, Hungary and Sweden have had very public differences over security matters.
Even as the fighter jet deal was announced, Orban commented that "we are pro-peace, and the Swedes are pro-war in the Russian-Ukrainian conflict", and he repeated his belief that a settlement to the conflict should be reached through negotiation not military actions.
"We do not agree on everything, but we do agree that we should work more actively together when we have common ground," added Kristersson.