Hungary's parliament voted in favor of Sweden's bid to join NATO on Monday afternoon.
Only a handful of MPs opposed the motion, after Prime Minister Viktor Orban's government allowed it to come to a vote following months of delay.
The motion passed passed with 188 votes in favor and six against.
Sweden hails 'historic day,' to be NATO's 32nd member
"Today is a historic day. The parliaments of all NATO member states have now voted in favor of Swedish accession to NATO. Sweden stands ready to shoulder its responsibility for Euro-Atlantic security," Swedish Prime Minister Ulf Kristersson wrote on social media soon after the vote.
Hungarian government spokesman Zoltan Kovacs posted on social media, "Hungary has a vested interest in Europe's security, and I am sure, that in Sweden we have a strong and reliable ally who will benefit the future of NATO for the better."
The matter had previously been stalled in parliament in Budapest over objections from lawmakers from Orban's ruling Fidesz party.
Unanimous support from all 31 NATO members is required for new countries to join the military alliance.
"I welcome the Hungarian parliament's vote to ratify Sweden's membership in NATO," NATO Secretary General Jens Stoltenberg said. "Now that all Allies have approved, Sweden will become the 32nd NATO Ally. Sweden's membership will make us all stronger and safer."
German Chancellor Olaf Scholz also welcomed the ratification of Sweden's accession to NATO by the parliament in Budapest, saying it was a "win for all of us."
"The decision strengthens our alliance and thus the security of Europe and the world," he wrote on social media.
What Orban said about Hungary supportung Sweden's NATO bid
"Today we ... will support Sweden's accession to NATO," Orban said at the start of the plenary session.
Orban said that he saw "no military solution" to the conflict between Ukraine and Russia and called for an immediate cease-fire and a negotiated settlement. He also referred to Russia as the aggressor in the conflict, saying it had "attacked" Ukraine.
Orban has said that criticism of the state of the rule of law in Hungary by Swedish politicians had led lawmakers in his party to object to Sweden's accession bid.
On Friday, Orban met with Swedish counterpart Ulf Kristersson in Budapest and indicated that his party would support Stockholm's bid to join NATO.
"We have managed to clarify our mutual good intentions," he said after signing a deal to acquire four Swedish-made fighter jets.
"To be a member of NATO together with another country means we are ready to die for each other," Orban said. "A deal on defense and military capacities helps to reconstruct the trust between the two countries."
The nationalist Fidesz holds two-thirds of the seats in parliament alongside its coalition partner, the Christian Democratic KDNP.
The only group in the opposition that opposed ratifying Sweden's NATO bid was the far-right Our Homeland party, which has six seats in parliament.
Sweden first applied to join the military alliance in May 2022 in response to Russia's invasion of Ukraine. Finland lodged its application at the same time and was admitted in April 2023.
Turkey had also long stalled on approving Sweden's NATO membership, demanding Stockholm do more to crack down on Kurdish groups. Turkish lawmakers ratified Sweden's bid late in January.
Orban, Fidesz snub minute of silence for Navalny
Orban and other politicians in the ruling coalition ignored a call by opposition lawmaker Bence Tordai of the Green party Dialogue to stand for a minute of silence for Russian Kremlin critic Alexei Navalny.
Navalny died in prison on February 16, which some of his allies and Western politicians have blamed on Russian President Vladimir Putin's government.
In comments on Monday, Orban thanked "government party groups for keeping their cool on the Navalny case."
"Chauvinists receive no respect in the Hungarian parliament, and those who called Georgians rodents during the Georgian-Russian war will not be respected," he said, referring to remarks made by Navalny amid Russia's 2008 invasion of Georgia.
Navalny later apologized for the comments.
"Otherwise, rest in peace," Orban added.
Hungary elects new president
After voting in favor of Sweden's accession to NATO, Hungary's parliament elected Tamas Sulyok, president of the constitutional court, as the country's next president, a largely ceremonial role. He is expected to take office on March 5.
Orban ally Katalin Novak, Hungary's first woman president, resigned earlier this month after it was revealed she had pardoned a convicted child abuser's accomplice.
The opposition has criticized the appointment of the politically inexperienced Sulyok.
About 3,000 people attended a protest on Sunday organized by four opposition parties calling for direct presidential elections.