Sweden has cleared its final obstacle to joining Nato after Hungary's parliament voted to ratify the bid.
The Nordic nation applied to join the defence alliance after Russia's full-scale invasion of Ukraine in 2022.
Every member must approve a new joiner, and Hungary had delayed, accusing Sweden of being hostile to it.
But last week Hungary's Prime Minister Viktor Orban said the two countries were now "prepared to die for each other".
All Nato members are expected to help an ally which comes under attack.
Swedish Prime Minister Ulf Kristersson said it was a "historic day" and a "big step" for Sweden to abandon 200 years of neutrality.
"Sweden is an outstanding country, but we are joining Nato to even better defend everything we are and everything we believe in," he said.
Nato Secretary General Jens Stoltenberg said the Hungarian decision made the alliance "stronger and safer".
The parliament's approval must now be signed by the president - after which a formal invitation is sent to Sweden to join the 31-member group.
The process usually lasts a few days.
Mr Orban is a nationalist politician with close ties to Russia's President Vladimir Putin. He has often blocked EU efforts to send military aid to Ukraine.
Sweden is one of the EU countries which have accused Hungary of backsliding on the EU's democratic principles.
In turn, Mr Orban's spokesman Zoltan Kovacs accused officials in Sweden of sitting on a "crumbling throne of moral superiority".
Last week, however, Mr Orban hosted his Swedish counterpart Ulf Kristersson and announced his support for Sweden's membership.
Monday's vote of Hungarian MPs was almost unanimous - 188 to 6.
In his speech, Mr Orban sharply criticised unnamed Nato allies for exerting pressure on his government to end the 21-month delay.
"Hungary is a sovereign country and does not tolerate being dictated to by others, on the content or timing of decisions," he said.
More about: