After long months of negotiations, Turkey’s parliament will approve Sweden’s NATO candidacy on Tuesday, overcoming the biggest remaining obstacle to expanding the Western military alliance after 20 months of delays.

Turkey’s general assembly, where President Recep Tayyip Erdogan’s ruling alliance has a majority, will vote on the request that Sweden first submitted in 2022 following Russia’s large-scale invasion of Ukraine.

Once parliament has ratified the measure, Erdogan is expected to sign it into law within days, leaving Hungary as the only member state that has not approved Sweden’s accession.

Hungary had pledged not to be the last ally to ratify it, but its parliament is in recess until mid-February. Prime Minister Viktor Orban said Tuesday that he has invited his Swedish counterpart to visit him and negotiate his country’s accession to the bloc.

Turkey and Hungary have better relations with Russia than other members of the US-led North Atlantic Treaty Organization.

While opposing Russia’s invasion of Ukraine, Turkey has criticized Western sanctions on Moscow, which has warned it would respond if NATO bolsters military infrastructure in the two Nordic states.

Sweden, whose bid for membership marked a historic shift in its security policy, would improve NATO’s defenses in the Baltic Sea region. Ankara’s delays have frustrated some of its Western allies and allowed it to extract some concessions.

When Sweden and Finland asked to join NATO in 2022, Turkey surprised some members by raising objections over the two countries’ alleged protection of groups Ankara considers terrorists.

However, Turkey backed Finland’s entry into the club in April last year but, along with Hungary, has kept Sweden waiting. Ankara had urged Stockholm to toughen its stance toward local members of the Kurdistan Workers’ Party (PKK), which the European Union and the United States also consider a terrorist group.

In response, Stockholm introduced a new anti-terrorism bill that makes it illegal to be a member of a terrorist organization. Sweden, Finland, Canada and the Netherlands also took steps to relax Turkey’s arms export policies.

Erdogan, who sent Sweden’s candidacy to parliament in October, has linked Sweden’s ratification to U.S. approval of sales of F-16 fighter jets to Turkey.

The White House supports the sale and some analysts expect a deal to be reached quickly following Turkey’s ratification of Sweden’s offer. But there is no clear timeline for approval by the U.S. Congress, and Turkey faces some opposition in Congress over the delay in NATO expansion and its human rights record.

Parliament’s foreign affairs committee approved the candidacy last month, with the backing of Erdogan’s ruling AKP, its nationalist allies MHP and the main opposition CHP. The nationalist and Islamist opposition parties rejected it.

MHP leader Devlet Bahceli said on Tuesday his party would also back Sweden’s candidacy in the general assembly vote.