ISTANBUL — Throughout last week, thousands of people demonstrated against Israel in Turkey. In a country where protests are often brutally shut down, the police did not attempt to break up the demonstrations. Because Erdogan supports Hamas, the Palestinian nationalist and Islamist movement that de facto governs Gaza. There are religious reasons for this that also fit right into his geopolitical strategy.

When it comes to the Middle East conflict — both before and after Thursday night's ceasefire — Turkish President Recep Tayyip Erdogan knows no compromise. He is currently inciting against anyone who speaks out for Israel, as if he were at war himself. U.S. President Joe Biden felt the wrath too: "We are forced to say that you are writing history with your bloody hands," Erdogan grumbled on Monday evening. He was alluding to Washington's allegedly planned, but as yet unconfirmed, arms sale to Israel worth $735 million.

Erdogan's words are unlikely to have any effect at the White House. The U.S. has been selling weapons to Israel for years and is aware of Ankara's pro-Palestinian orientation. So far, the U.S. assumed it could take advantage of the situation. For example, a report published three years ago by the US-affiliated think tank "Rand Corporation" says Turkey was brought into play in the Middle East conflict as an important mediator, largely because of its support for the Hamas.

Erdogan feels connected to Hamas through its mutual closeness to the Muslim Brotherhood. It's about religion, about political power and about the fear of Western dominance.

And to corner Israel, Erdogan has considered a move that could sound threatening to the political West. As the Turkish right-wing conservative newspaper Yeni Safak reports, Ankara is considering an agreement on a joint exclusive economic zone with Hamas.

The idea is that if the waterway across the Mediterranean between Turkey and Gaza becomes a common zone for Turkey and Palestine, Ankara can use it to deliver weapons or other aid without interference. An added advantage for Turkey is that such an economic zone would also hinder the planning of a rumored joint gas pipeline between Israel, Greece and Cyprus to go ahead.

So far, however, this agreement is only Ankara's castle in the air. Because there is a problem with the project: A contract signed with the Hamas, which the United Nations lists as a terrorist organization, is unlikely to find international recognition.

I curse the Austrian state.

Erdogan's curses and insults, on the other hand, are different. In the eyes of the Bavarian Interior Minister Joachim Herrmann, the brutal rhetoric of the Turkish President is partly responsible for the pro-Palestine demonstrations on German soil that occasionally turned violent. "Most of what we are experiencing is not right-wing extremism, but rather people with a Muslim background who, incited to some extent by Erdogan's brutal speeches, think they have to fight these conflicts on German streets," Herrmann said.

There were also tensions with Austria. As a sign of solidarity with Israel in the Gaza conflict, the Chancellery and the Foreign Ministry waved an Israeli flag on Friday. "I curse the Austrian state," raged Erdogan. "The Austrian state is probably trying to bill the Muslims for the Jews who subjected it to genocide."

Austria quickly summoned the Turkish ambassador in Vienna to the Ministry of Foreign Affairs. "The Middle East conflict will not be resolved with foam from the mouth," Foreign Minister Alexander Schallenberg said about the incident.

Destruction in Beit Hanoun, Gaza on May 21 — Photo: Ashraf Amra/APA Images/ZUMA

For Erdogan, the escalation in the Middle East is also useful domestically. While he has recently faced growing pressure, among other things because of Turkey's ailing economy, anger against Israel can reunite people behind him. At least in the short term, the calculation seems to be working: Erdogan's words fueled pro-Palestine protests in Turkey by his supporters.

In Istanbul, for example, several thousand people took to the streets about a week ago despite the coronavirus curfew. They waved Palestinian and Turkish flags, chanted religious and anti-Israeli slogans and set off fireworks. Protesters held signs with sentences like "al-Quds belongs to Muslims", with al-Quds being the Arabic name for Jerusalem.

A centuries-old religious dispute gives him new energy each time.

In fact, the city, claimed by Israelis and Palestinians alike, is also Erdogan's central concern in the conflict. It is not just about solidarity with the Palestinian people, but above all about Jerusalem. The city is the third most important holy place for devout Muslims like the Turkish president.

In the escalation with Gaza, a centuries-old religious dispute gives him new energy each time. Jerusalem has been an important symbol of Muslim world power since the rise of Islam. In his view, Israelis want to drive the Muslims out of the city. "For us Muslims, every day that Jerusalem is occupied is a violation," Erdogan said in May 2017.

He sees himself as the de facto leader of the Islamic world and wants to continue the line of great Islamic rulers, such as Selahattin Eyyübi, also known as Saladin the Victorious. The ruler of Kurdish origin united the Muslims of the Middle East in the 12th century and recaptured Jerusalem from the Christian crusaders in 1187.

Jerusalem is not important to Turkey for religious reasons alone. Losing the holy site, which for centuries was under the rule of the Ottomans, to non-Muslims, stirs up fear in the Turkish state and in the population that it will be overlaid and infiltrated by the West.

This concern has deep historical roots: when, for example, after the Russo-Ottoman War in 1878, Jewish settlers came to the Middle East with the support of the West, the Ottoman government saw this as a threat to their power and the existing order. Sultan Abdulhamid I did everything possible to prevent the settlements.

When Erdogan complains about Israel today, he is not addressing the Jews directly. According to his world view, Jews are allowed to live and practice their faith — just not as a dominant power, and certainly not by controlling Jerusalem. Most recently, however, Erdogan had accused Israel, among other things, of terrorism against the Palestinians and said that this was "in the nature" of the Israelis. The U.S. government described his statements as anti-Semitic.

It is not clear whether the ceasefire between Israel and Hamas will hold, but you can be sure Erdogan will continue to have his say.

See more from World Affairs here