VILNIUS, Lithuania (AP) -- When long-neutral Sweden applied for NATO membership together with Finland, both expected a quick accession process.
More than a year later, Finland is in, but Sweden is still in the alliance's waiting room.
New entries must be approved by all existing members and as NATO leaders meet for a summit in Vilnius, Sweden is missing the green light from two: Turkey and Hungary.
A major obstacle was overcome Monday when Turkey's president agreed to send NATO's accession documents to the Turkish Parliament for approval, something he had refused to do for more than a year.
That means Sweden is now close to becoming NATO's 32nd member, though not quite yet over the finish line. Here's what to know about Sweden's tumultuous road toward joining the alliance.
FAREWELL TO NEUTRALITY
For a country that hasn't fought a war in two centuries, the decision to join NATO was huge. Sweden declined to take sides during both world wars and throughout the Cold War, embracing neutrality as core to its security policy and even its national identity.
Though it tweaked its status to "nonaligned" after joining the European Union in 1995 and gradually increased cooperation with NATO, Stockholm until last year ruled out applying for membership, with public opinion firmly against it.
As late as November 2021 -- three months before Russia's full-scale invasion of Ukraine -- then-Defense Minister Peter Hultqvist promised that Sweden would never join NATO while his center-left Social Democrats were in office.
Then the war started. As Russian tanks rumbled across the Ukrainian border and missiles struck Kyiv and other cities, public opinion shifted in both Finland and Sweden. Even Hultqvist and the Social Democrats made a U-turn, and in May last year Sweden and Finland jointly applied for NATO membership.
TURKEY SAYS NOT SO FAST
Most observers expected Sweden and Finland's applications to be fast-tracked, since they already fulfilled the membership criteria and the Ukraine war added urgency. Twenty-eight NATO countries ratified the accession protocols swiftly.
But Turkish President Recep Tayyip Erdogan had a different idea. He said Turkey could not welcome the Nordic nations as NATO allies unless they cracked down on groups that Ankara views as security threats, including the banned Kurdistan Workers Party, or PKK, which has led a decades-long insurgency in Turkey.
Sweden has accepted more than 1 million refugees in recent decades, including tens of thousands of Kurds from Turkey, Iran and Iraq. Some of them sympathize with the PKK, which is designated as a terrorist group by the European Union.
Seeking to address Erdogan's concerns, Finland and Sweden signed a deal with Turkey at last year's NATO summit in Madrid. They agreed to resume weapons exports to Turkey that were suspended following a 2019 Turkish incursion into Kurdish areas in northern Syria, tighten anti-terror laws and step up efforts to prevent PKK's activities in their countries.
When Swedes elected a center-right government last September, negotiations with Turkey were expected to become a little easier because the previous Social Democratic government had been burdened by its support for Kurdish militants in Syria with links to the PKK.
But things got complicated in January when pro-Kurdish activists briefly hung an effigy of Erdogan from a streetlight outside Stockholm's City Hall. Soon after, an anti-Islam activist from Denmark burned the Quran outside the Turkish Embassy in Stockholm.
If the purpose was to stall Sweden's NATO bid by infuriating Turkey, the protests had the desired effect: Ankara froze NATO talks with Sweden, while allowing Finland to join in April. Conservative Prime Minister Ulf Kristersson's government spent months trying to repair the damage.
Just as relations appeared to be improving, a refugee from Iraq staged another Quran-burning protest last month outside a mosque in Stockholm, dimming hopes that Turkey would unblock Sweden's accession before the NATO summit in Vilnius.
WHO'S BEHIND THE PROTESTS?
The anti-Erdogan protests have gathered pro-Kurdish and far-left demonstrators in Sweden. Some participants have waved PKK flags. Meanwhile, the Quran burnings were carried out by a far-right activist from Denmark and a Christian refugee from Iraq. They might not have gotten much attention if it weren't for the NATO spotlight, but with Ankara keeping a close eye on developments in Sweden, the protests made headlines in Turkey and other Muslim countries, where leaders slammed Sweden for allowing them. That provoked a discussion in Sweden about whether Quran-burning can be considered incitement to hatred, which is illegal, or a lawful expression of opinion about a world religion.
Swedish officials are trying to assure Turkey that Sweden is not an Islamophobic nation, stressing that the government does not condone Quran-burnings but cannot stop them, citing freedom of speech. The government's strong condemnations of the protests have caused a backlash domestically with critics accusing Kristersson of bending over backward to placate Turkey.
The protests have also raised suspicions of Russian interference. As soon as Sweden launched its membership bid, the country's security service warned that Moscow might increase influence activities during the application process. However, no proof has emerged of Russian links to the protesters.
WHAT ELSE DOES TURKEY WANT?
Turkey's holding up of Sweden's NATO bid irritated the United States and other allies. Some analysts suggested Turkey was using its leverage to press for upgraded F-16 fighter jets from the U.S. While both Turkish and U.S. officials have said the Swedish accession process and the F-16 upgrades are not connected, President Joe Biden implicitly linked the two issues in a phone call to Erdogan in May.
"I spoke to Erdogan and he still wants to work on something on the F-16s. I told him we wanted a deal with Sweden. So let's get that done," Biden said.
Just before departing for NATO summit in Vilnius on Monday, Erdogan came up with yet another demand. He said European countries should reopen long-frozen talks to let Turkey into the European Union. "When you pave the way for Turkey, we'll pave the way for Sweden as we did for Finland," he said.
After Erdogan met separately with Kristersson and EU Council President Charles Michel in Vilnius, NATO's secretary general announced a breakthrough: Erdogan was ready to send Sweden's accession protocol to the Turkish Parliament in return for deeper cooperation on security issues and Swedish support for reviving Turkey's quest for EU membership.
While celebrating the agreement as a "very big step on the road" toward NATO membership, Kristersson stopped short of calling NATO membership a done deal, noting it was unclear when the Turkish Parliament would make its decision.
WHAT ABOUT HUNGARY?
Unlike Turkey, Hungary has not given a reason for why it hasn't yet ratified Sweden's NATO membership. Hungary pursued close economic and diplomatic ties with Russia before the war. Since it started, Prime Minister Viktor Orban has refused to back Ukraine with weapons and argued against European Union sanctions on Moscow.
During a visit to Vienna last week, Orban denied that Hungary was delaying Sweden's membership bid.
"We support the Swedish accession, but the Hungarian parliament has not yet ratified the decision," he said. "We are in constant contact with the NATO secretary-general and the Turks. So if we have something to do, we will act."
Many analysts believe that Orban is waiting for Erdogan's next move and that Hungary will approve Sweden's accession if Turkey looks likely to do the same. That's what happened with Finland's accession.