Finland and Sweden now have a clear path to membership in the North Atlantic Treaty Organization, the alliance's Secretary General Jens Stoltenberg said Tuesday, as Turkey has withdrawn its opposition which had served as a major obstacle to the two countries joining.

"I am pleased to announce that we now have an agreement that paves the way for Finland and Sweden to join NATO," Stoltenberg told a press conference following a trilateral meeting between Turkey, Finland and Sweden.

The development came on the eve of the 30-member trans-Atlantic alliance's summit to be held in Madrid.

In May, Finland and Sweden submitted applications to join NATO, marking a historic change in the Nordic countries' longstanding military nonalignment policies in the wake of Russia's attack on Ukraine.

Their accession was initially expected to proceed swiftly, but the moves hit a snag when Turkey voiced opposition, alleging the two nations support people Ankara deems terrorists such as members of the Kurdistan Workers' Party, known as PKK.

Stoltenberg said Finland and Sweden have committed to supporting Turkey against threats to its national security, such as by cracking down on the PKK's activities and entering into an extradition agreement, which has prompted Turkey to drop its veto.

He also said the entry of the countries into the alliance will not only enhance their own security, but will strengthen NATO and make the Euro-Atlantic area more secure, given that the two nations have advanced weapons systems technology as well as strong, stable political institutions.

Stoltenberg did not say exactly when the two countries will acquire membership, given that all 30 NATO countries must ratify the applications to approve new members.

With their participation, NATO's border with Russia would roughly double in length, almost certainly changing the geopolitical landscape in Europe.

Sweden has not participated in a war since the Napoleonic Wars in the 19th century, when it lost territory, and has preferred a neutral mediation role in international disputes.

Finland, which has a 1,300-kilometer border with Russia, adopted neutrality after fighting with the Soviet Union during World War II and losing some of its territory.

But the importance of being part of the security alliance has been highlighted following Russia's aggression, with the United States vowing to defend "every single inch" of NATO territory based on the principle of collective defense.

Ukraine, which is not a NATO member, has had to continue fighting on its own to repel Russian forces, although the United States and other NATO members have provided massive security and other assistance.

Russia began its military attack against the former Soviet republic on Feb. 24 after asserting that its security was under threat from the NATO's eastward expansion and the possibility of Ukraine joining the security alliance.