What had been billed a groundbreaking visit to Greece, the first by a Turkish president in 65 years, turned into a verbal theatre of war as Recep Tayyip Erdoğan, flouting the niceties of diplomacy, crossed an array of red lines.

Disputes that had lain dormant – not least the 1923 Treaty of Lausanne delineating the borders between the two nations – were prised open with brutal force on Thursday by Erdoğan on the first day of a historic visit dominated by the leader’s unpredictability.

Within an hour of stepping off his plane, the pugilistic politician was sparring with the Greek head of state, Prokopis Pavlopoulos. Athens, he said imperiously, would never have entered Nato had it not been for Ankara’s support. As an ally, it should seek to improve the religious rights of the Muslim minority in Thrace which were enshrined in the Lausanne treaty, he insisted, sitting stony-faced in the inner sanctum of the presidential palace. “It needs to be modernised,” he said of the treaty, which has long governed Greek-Turkish relations and is seen as a cornerstone of regional peace.

A visibly stunned Pavlopoulos hit back, calling the treaty non-negotiable.

“The Treaty of Lausanne defines the territory and the sovereignty of Greece, and of the European Union, and this treaty is non-negotiable. It has no flaws, it does not need to be reviewed, or updated.”

With tensions running high between the two long-time Nato rivals and neighbours, Athens had hoped the 48-hour sojourn would put fraught bilateral relations on a new footing. International condemnation of Erdoğan’s crackdown on democratic institutions, following a foiled coup against him last year, has strained relations with Europe and the US and meant that the Turkish leader has made fewer trips to the west. Greek officials thought he would use the visit to strike a conciliatory note. The red carpet was duly rolled out with military bands and Greece’s ornately dressed presidential guard doing the honours.

In what will be remembered as one of the biggest security operations in living memory – with 2,800 police deployed around the capital, snipers posted on rooftops, and commandos, sniffer dogs, bomb disposal experts and bodyguards drafted in – the visit brought Athens to a standstill.

But the 63-year-old Turkish leader, while thanking his hosts for the welcome, continued to ratchet up the rhetoric.

In subsequent talks with the prime minister, Alexis Tsipras, he chastised the Greeks for failing to look after Ottoman sites and provide a proper place of worship for Muslims. Cyprus, he argued, had not been reunified because Greek Cypriots kept turning down a “just and sustainable” settlement. He also attacked the “economic chasm” between Greeks, who earned on average €15,000 a year, and the Turkish-speaking Muslim minority in northern Thrace who earned around €2,200 a year.

Athens, he continued, should also return the eight Turkish officers who had escaped to Greece as the coup unfolded even if the country’s judicial system had blocked their repatriation on the grounds that they would not be given a fair trial. “It is possible to return them to Turkey, which is a country that has abolished the death penalty and is not a country of torture,” he told a press conference in the prime minister’s office.

Looking on in dismay – Greek ministers exchanging knowing smiles around him – Tsipras repeated that as the birthplace of democracy, where executive power was separate from the law, Greece respected decisions made by the country’s justice system.

Earlier, the 43-year-old had attempted to ameliorate the frosty atmosphere, telling his guest that respect for international law was the basis of solid ties between the two neighbours.

“Differences have always existed and [they exist] today,” the leftist leader said. “It is important … that we express our disagreements in a constructive way, without being provocative.”

The visit follows the arrests in Athens of nine Turkish nationals charged last week with being members of DHKP-C, a militant Marxist group that has claimed responsibility for suicide bombings in Turkey.

Facebook Twitter Pinterest Kurdish demonstrators holding placards march during a protest against the Turkish president’s Athens visit. Photograph: Petros Giannakouris/AP

“The visit comes at an especially delicate time, diplomatically, given mounting criticism of his crackdown on perceived and real participants in the coup and other domestic opponents,” said Hubert Faustmann, professor of history and political science at the University of Nicosia.

Relations between Turkey and Greece have long been strained. Hostility can be traced back to the subjugation of Greeks under Ottoman rule before a bloody war of independence initiated in 1821 led to the creation of the modern Greek state in 1830.

Successive conflicts followed, most notably in 1922 when the Greek army suffered a disastrous defeat in Asia Minor, prompting a massive exchange of populations – widely seen as the first experiment in ethnic cleansing – and the establishment of the Republic of Turkey.

The two countries came close to war again in 1996 over a pair of uninhabited isles in the Aegean Sea. Most recently, tensions have resurfaced over Greece’s frontier role in the refugee crisis, failed talks to reunify Cyprus and, according to officials in Athens, Turkey’s repeated violations of Greek air and naval space in the Aegean.

The defence ministry claims more than 3,000 airspace violations have occurred this year, more than at any other time since 2003. Erdoğan’s open questioning of the peace treaty that forged the boundaries of the two states has exacerbated friction even further.

The Greeks are also acutely aware that geography means they must coexist with Turkey and stand to benefit most if Ankara remains anchored to Europe.