Turkey's parliament has approved Sweden's application to join NATO - lifting a key barrier to its entry into the military alliance.
The decision means Hungary is the only NATO member yet to ratify Sweden's application after 20 months of delays.
Sweden's membership would enhance the military alliance's defences in the Baltic Sea region facing Russia.
Swedish Prime Minister Ulf Kristersson wrote on the social media site X after the decision: "Today we are one step closer to becoming a full member of NATO. Positive that the Grand General Assembly of Türkiye has voted in favour of Sweden's NATO accession."
NATO chief Jens Stoltenberg has also welcomed the Turkish parliament's decision to ratify Sweden's membership bid and called on Hungary to follow suit.
"I also count on Hungary to complete its national ratification as soon as possible," he said in a statement late on Tuesday.
"All NATO allies agreed (at the summit) in Vilnius to invite Sweden to join our alliance, and Sweden has fulfilled its commitments. Sweden's membership makes NATO stronger and all of us safer."
United States national security adviser Jake Sullivan wrote on X following the decision in Turkey: "This has been an important priority for (President Joe Biden).
"Sweden is a strong, capable defence partner whose membership in NATO will make the US and the Alliance safer and stronger."
Western allies were frustrated by application delays
Turkey had been stalling Sweden's accession into NATO for more than a year, accusing the country of being too lenient towards groups the Turkish government regards as security threats.
The NATO member had been seeking concessions from Sweden, including a tougher stance toward Kurdish militants and members of a network Turkey blames for a failed coup in 2016.
Turkey has also been angered by a series of demonstrations by supporters of the outlawed Kurdistan Workers' Party in Sweden as well as Koran-burning protests in the country that angered Muslim nations.
However, Turkey's parliament approved Sweden's NATO membership bid on Tuesday following more than four hours of debate.
President Recep Tayyip Erdogan's ruling AK Party, its nationalist MHP allies, and the main opposition CHP voted 287-55 in favour of the bid in the general assembly, while opposition nationalist, Islamist and leftist parties voted against it.
Mr Erdogan will sign the bill into law, likely in the coming days, thus ending a lengthy process that has both frustrated some of Turkey's Western allies and enabled it to extract concessions.
Swedish prime minister invited to Hungary
Turkey's decision comes after Hungarian prime minister, Viktor Orban, said on Tuesday he had invited Mr Kristersson to visit Hungary and negotiate over Sweden's NATO ambitions.
No specific date was proposed for the visit.
Hungary's foreign minister, Peter Szijjarto, told reporters on Tuesday the aim of the visit would be to "build trust".
Hungary's parliament is in recess until around mid-February.
Swedish Foreign Minister Tobias Billstrom told Swedish news agency TT there was no reason "to negotiate in the current
situation, though... we can have a dialogue and continue to discuss questions".
Sweden applied to join NATO in May 2022 in a historic shift in its security policy prompted by Russia's invasion of
Ukraine in February that year.
While opposing Russia's invasion of Ukraine, Turkey has criticised Western sanctions on Moscow.
For its part, Russia has cautioned that it would respond if NATO bolstered military infrastructure in Sweden and Finland - with the latter becoming an official member of the military alliance in April 2023.
Watch our new foreign affairs show, The World With Yalda Hakim, from Monday to Thursday between 9pm and 10pm on Sky News.