Turkey's President Tayyip Erdogan holds a news conference during the NATO summit at the Alliance's headquarters in Brussels, Belgium June 14, 2021.Turkey’s President Tayyip Erdogan holds a news conference during the NATO summit at the Alliance’s headquarters in Brussels, Belgium June 14, 2021.

NATO officials on Tuesday celebrated the lifting of Turkey's veto against Sweden and Finn joining the alliance, a move that brought the Nordic states one step closer to full NATO membership.

Turkey's initial opposition was a major stumbling block and a surprise to many. In the face of Russia's aggression, Sweden and Finland decided to end their nonaligned positions and join the alliance.

The relationship between Sweden and groups that Turkey considers to be a terrorist threat was the focus of the demands made by the president of Turkey.

Analysts say that a big win for NATO is also a victory for the president in order to shore up domestic support as his economy struggles with high inflation.

In a note Wednesday, Timothy Ash, an emerging markets strategist at Bluebay Asset Management, said that Putin is the big loser in this. It was a good decision by the president.

Ash wrote that he negotiated hard, right up to the last minute, and got real wins with assurances. He's going to have a one-on-one with Biden in Madrid. He came back from the cold with the west.

The breakthrough with Turkey was the culmination of four hours of talks and weeks of debate. The agreement involved the Nordic countries lifting arms embargoes they had previously imposed on Turkey, toughening their laws against Kurdish militant activists that Ankara deems to be terrorists, and addressing Turkish request for suspected Kurdish fighters.

One of the largest ethnic groups in the world, the Kurds, live in Turkey. Their population is spread across Turkey, Iraq, Iran and Syria as well as in immigrant diasporas around the globe. Kurds have faced a lot of persecution in Turkey.

The PKK, or the Kurdish Workers' Party, has been at war with the Turkish state since the 1980s and has resulted in more than 40,000 deaths.

Syrian Kurds gather around a US armoured vehicle during a demonstration against Turkish threats next to a base for the US-led international coalition on the outskirts of Ras al-Ain town in Syria’s Hasakeh province near the Turkish border on October 6, 2019.

The PKK is a terrorist organization. The two Nordic states deny that they support the PKK. Turkey doesn't differentiate between the PKK and other Kurdish groups in Syria, but Sweden does.

A guarantee of better cooperation on this issue and demonstrated respect for its security needs was the priority for the president.

The Turkish president's office said that Turkey "got what it wanted" from the deal. That meant full cooperation with Turkey in the fight against the PKK and its affiliates, including a PKK group in Syria that had been supported by the U.S.

The two countries promised not to impose embargo restrictions on Turkey and to take concrete steps to extradite terrorist criminals.

The NATO summit in Madrid will see a one-on-one meeting between the U.S. president and the Turkish president. He is expected to push for the U.S. to sell F-16 fighter jets to Turkey.

It is not clear if the F-16 sale will go through, but it is expected to do so as a gesture of unity following the acceptance of NATO applicants. Turkey was kicked out of the F-35 program by the U.S. after buying a Russian missile defense system.

Ash hoped the U.S. Congress did not put a roadblock in the way of the deal. All U.S. arms sales must be approved by congress.

The leaders of Finland and Sweden have both said a decision on whether to apply for NATO membership can be expected sooner rather than later.

To feel like he got a good deal, Erdogan needs to see actions.

Hakki Akil is a former Turkish ambassador who served in the Middle East and Europe. Political pressure from influential Kurdish groups in Sweden may cause some internal policy problems.

The internal political impact of the agreement might be limited due to the economic situation in the country.

A lot can happen between now and June 23, 2023, when Turkey's presidential election will take place. By getting some concessions from the West and proving that he can use leverage to his advantage, he can return to Turkey with something to show for his efforts.

The economic crisis hitting the country of 84 million may ultimately play a bigger role.

"Erdogan has again shown his pragmatism, avoiding a crisis, taking some political capital, which he will hope to deploy domestically in elections." The election outcome is not certain.