Greek Prime Minister Alexis Tsipras attends a parliamentary session before a vote for an omnibus bill cutting spending on pensions, speed up privatisations and reform the electricity market, in Athens, Greece, September 27, 2016. REUTERS/Alkis Konstantinidis

ATHENS (Reuters) - Greece on Friday accused neighboring Turkey of endangering ties between the two NATO allies by questioning the wisdom of an almost century-old treaty that established the modern boundaries between the two countries.

At a speech in Ankara on Thursday, Turkish President Tayyip Erdogan said the Treaty of Lausanne, a 1923 peace accord which forged modern Greece and Turkey’s borders, was essentially a defeat for Turkey because it “gave away” islands to Greece.

Ties between Greece and Turkey have suffered strains over the years, because of squabbles over sea boundaries between the two countries and because of divided Cyprus, ethnically split between its Greek and Turkish Cypriot populations since 1974.

The two countries almost went to war over an uninhabited islet in the Aegean in 1996. But tensions have eased over the years, particularly after each rushed to the other’s aid in separate earthquakes affecting both countries in 1999.

“Questioning the Treaty of Lausanne, which established norms in Greco-Turkish relations (and) the status quo in the Aegean and its islands, is dangerous to relations between the two countries and to the broader region,” Tsipras’s office quoted him as telling senior government officials.

Greece, Tsipras said, would not respond in a similar manner.

At the Ankara speech on Thursday, Erdogan said: “We gave away islands to Greece that we could reach with a shout in Lausanne. Is this victory? They tried to trick us into believing that Lausanne was a victory.

“Those who sat at that table did not do right by that treaty. Now, we suffer its setbacks.”