FILE - NATO Secretary-General Jens Stoltenberg is pictured in Munich, Germany, Feb. 15, 2020. Stoltenberg said Sept. 3 that Turkey and Greece had agreed to talks to try to avoid accidents as Turkey conducts a naval exercise in the eastern Mediterranean.

ISTANBUL - Turkey and Greece have agreed to talks to try to avoid any accidents as Turkey conducts a major naval exercise in eastern Mediterranean waters that Greece has been contesting.

Fears have been growing of a confrontation between the NATO members. Diplomatic efforts floundered until NATO Secretary-General Jens Stoltenberg issued a statement Thursday.

"Following my discussions with Greek and Turkish leaders, the two allies have agreed to enter into technical talks at NATO to establish mechanisms for military deconfliction to reduce the risk of incidents and accidents in the eastern Mediterranean," Stoltenberg’s statement said.

Turkey and Greece vehemently disagree over claims to natural gas reserves in the eastern Mediterranean Sea and the extent of their continental shelves.

Ahead of the two-week naval exercise that began Tuesday, President Recep Tayyip Erdogan launched a verbal salvo against Greece, accusing it of "banditry and piracy."

The Turkish drill is the latest in a reciprocal escalation of bilateral tensions. Ankara's latest move was made in response to Athens' deployment of soldiers on the Greek Island of Kastellorizo, close to Turkish territory. Greece insists the deployment is only a regular rotation of soldiers, but Ankara is accusing Athens of playing a dangerous game.

"This is a kind of testing Turkey — please do not try to test Turkey," warned professor Mesut Casin, a Turkish presidential adviser. "No one can estimate the Turkish response. One day we can wait, we can wait, we can be patient. But one day, our answer can be very bad."

FILE - The Turkish drilling vessel Yavuz is seen being escorted by a Turkish navy frigate in the eastern Mediterranean off Cyprus, Aug. 6, 2019.

The discovery of vast natural gas reserves in the eastern Mediterranean has unleashed a scramble for energy, and with it the renewal of a decades-long territorial dispute between these historic rivals that had been simmering.

Navies deployed

Greece accuses Turkey of searching for energy in its sovereign waters. Both countries have deployed their navies to back their conflicting claims over vast swaths of the sea, dividing the neighbors.

In a widening of the crisis, France deployed fighter jets and warships to support its fellow European Union member Greece. The French move strengthens Athens' hand against its much more powerful Turkish rival, according to Cengiz Aktar of Athens University.

Aktar warned, though, that the growing military presence in the region increases the danger of conflict.

"There might be a confrontation, not the least because of the number of navy ships and accompanying fighter jets in the area," said Aktar. “It's really crowded. It's like a traffic jam going on there — anything can happen."

Additionally, Turkey has changed the rules of engagement for Turkish warships.

“Turkey gave an order of authority to commanders of the warships for engagement, and this is very dangerous,” said Casin. “Now, Turkey shooting down a French or Greek plane is casus belli" — a Latin expression meaning an event that provokes or Is used to justify war.

Until now, Turkish commanders could engage only with permission from the country's military high command in Ankara.

But NATO may have succeeded in putting a brake on the growing confrontation.

FILE - Turkey's Foreign Minister Mevlut Cavusoglu, right, and German counterpart Heiko Maas speak to reporters after their talks, in Ankara, Turkey, Aug. 25, 2020.

Germany, holding the rotating EU presidency, had sought to break the impasse. Last month, German Foreign Minister Heiko Maas engaged in shuttle diplomacy between Athens and Ankara. But Maas' efforts proved fruitless, and he warned that the two countries were facing the "abyss."

Ankara welcomed Berlin's efforts, and Erdogan enjoys a good relationship with his German counterpart, Angela Merkel.

But Greece's relations with Germany are more complicated.

"The Greeks don't trust the Germans, and they have their reasons," said international relations professor Serhat Guvenc of Istanbul's Kadir Has University. "During the [Greek 2009] financial crisis, the anti-German feeling peaked in Greece.”

During the period that began in 2009, Berlin drew the ire of Athens by being at the forefront of demands that Greece introduce stringent austerity measures.

"I don't think Germany can play a role," said Aktar of Athens University. "Germany is a political and military dwarf, and their attempt to be a so-called honest broker and employ an equal-distance policy failed grossly.”

Possible Athens calculation

Athens also could be calculating it has a winning position over Turkey. Greece, backed by diplomatic heavyweight France, is looking to the EU to impose economic sanctions to force Turkey to back down.

"There is new consciousness developing in the European governments," said Aktar. "They realize the more they appease [Turkey], the more the Turkish regime abuses."

"We will not back down against the language of sanctions and threats," Erdogan said at a rally of supporters last month. Taking a tough stance against the EU and Greece plays well with his conservative and nationalist voting base.

"It's only Washington that can talk these two sides out of the crisis," said Guvenc. "But Washington has a problem now. They have [presidential and congressional] elections, and most importantly, there is this unpredictable president in power."

U.S. Secretary of State Mike Pompeo on Wednesday called on Turkey and Greece to de-escalate.

Washington successfully helped to avert the last military crisis between its NATO partners.

"In the previous [Greek-Turkish] crisis in 1996,” recounted Guvenc, “[President Bill] Clinton sent in the late Ambassador Richard Holbrook to deal a clear and very strong message to both sides that whoever starts the war, they will be fighting the Americans. But I don't see a Washington that can articulate and deliver such a strong message."

"Turkey and rest of the democratic world are waiting for these [U.S.] elections to pass, and the return of U.S. leadership," said Turkish presidential adviser Casin. "Because there may be one accident, and who will stop an enlarging of the conflict? One day, we may see a big catastrophe."