Turkey’s Erdogan endorses Finland’s NATO bid.

Turkey announced on Friday that it would move to ratify Finland’s application to join NATO, clearing a major hurdle to the Nordic nation’s bid to join the alliance but leaving neighboring Sweden on the sidelines for now.

“We decided to start the ratification process in our parliament for the membership of Finland,” Turkey’s President Recep Tayyip Erdogan told a news conference, saying he hoped the vote would take place before the midterm elections. of May.

The announcement came as Finnish President Sauli Niinisto met Erdogan in Ankara. Both leaders had telegraphed that the announcement would be made, and Erdogan said this week that Turkey would “keep our promise.”

For Finland joining NATO after decades of military non-alignment would be a major shift in the balance of power in the region between the Western military alliance and Russia. It represents a major diplomatic and strategic defeat for Moscow and Russia’s President Vladimir V. Putin.

Putin made it clear before invading Ukraine last year that his intention was to block NATO expansion. But his invasion instead convinced the Finnish and Swedish leaders that there was no real guarantee of security for them outside the alliance.

Finland has an 830-mile border with Russia, the longest in Europe, and a long history of resistance to Moscow’s hegemony. By favoring self-reliance, Finland did not reduce its military after the collapse of the Soviet Union, and 10 months ago dragged a more reluctant Sweden into applying for NATO membership.

But Erdogan has been blocking them, claiming that Sweden has become a haven for Kurdish separatists and other dissidents he views as terrorists. So far, Stockholm’s efforts to satisfy him, including a new anti-terror law, have failed.

The Turkish president has intermittently called for the extradition of more than 120 people now in Sweden, as he did again on Friday. Talks are likely to continue with the hope that Turkey will finally approve Sweden’s bid for membership after Turkey’s elections in May, but before the NATO summit in Lithuania in mid-July.

Mr. Erdogan’s decision opens the way for Turkey’s parliament to ratify Finland’s membership in the alliance, which requires the unanimous approval of the bloc’s 30 nations. Hungary is the only other country whose parliament has not ratified the Finnish or Swedish offers. Its leader, Prime Minister Viktor Orban, has vacillated over when the Hungarian parliament will vote, though he insists Hungary has no objection to membership of either Nordic country.

With the elections in Finland on April 2, the current government of the country decided to pass all the necessary legislation to join NATO in order to avoid any period of uncertainty while a new government is formed. So the only votes pending are those of the Turkish and Hungarian parliaments.

On Friday, Niinisto thanked Erdogan for the decision to ratify, but told the press conference that Finland’s membership “is not complete without Sweden.”

The Turkish leader faces a tough electoral battle in mid-May with a fragile economy and high inflation, as well as criticism of his government’s handling of the recent devastating earthquake. The battle against Kurdish terrorism is popular politics in Turkey and also plays well with opposition voters. And Turks in general like the attention and influence that Erdogan’s unpredictability often brings.

Hungary has used its veto power within the European Union over sanctions against Russia to try to secure concessions on other issues, and analysts say Orban appears to be doing the same with Finland and Sweden joining NATO. Mr. Orban is also known to be upset by criticism of Hungary within the European Union by Sweden and Finland.

Juana Lemola, gulsin harman and anushka patil contributed reporting.