Turkish President Recep Tayyip Erdogan's links to Hamas are under growing scrutiny following the group's deadly assault on Israel. Erdogan has positioned himself as a mediator in securing the release of Israeli civilians, but his connections to the Palestinian militant group are now casting a shadow over ongoing Turkish-Israeli rapprochement efforts.
On Monday, thousands of people gathered outside one of Istanbul's most important mosques to chant in support of Hamas while condemning Israel.
Much of Erdogan's support base is religious and anti-Israel, but last Saturday's Hamas attack is putting the Turkish leader in a difficult position.
For more than a year Erdogan has been engaged in repairing relations with Israel. In a groundbreaking event last month, the Turkish leader met for the first time with Israeli Prime Minister Benjamin Netanyahu on the sidelines of the United Nations General Assembly in New York.
Erdogan is now performing an increasingly difficult balancing act, trying to keep the Israeli rapprochement alive while resisting his supporters' anger towards Israel.
Erdogan's "initial reaction and his second reaction have been pretty mild given his previous reactions to such things", according to Soli Ozel, professor of international relations at Istanbul Kadir Has University.
"But on the other hand all his base appears to be gung-ho about what has happened, at least the initial thing. And he himself seems to be hardening his talk."
Israel could be performing a similar balancing act. The Israeli embassy in Turkey released a video thanking Turkish citizens who expressed solidarity with the Israeli people through social media.
For now, Israel is focusing on the positive: Israel and Turkey have shared interests in regional hot spots like the Caucasus, where both are concerned about Iran's influence.
Hamas operatives in Turkey
But Erdogan's relations with Hamas are expected to come under growing scrutiny.
In July, Erdogan held talks with Hamas's political leader, Ismail Haniyeh. The two men have met many times over the years. At the same time, Israel claims that many senior Hamas members reside in Turkey.
"The fact that Hamas operatives are operating in Turkey is alarming from the Israeli perspective," says Gallia Lindenstrauss, an analyst at Tel Aviv's Institute for National Security Studies.
"Turkey, I hope, will re-evaluate the Hamas situation soon, in the future," commented Mesut Casin of Istanbul's Yeditepe University, a Turkish presidential adviser and long-time proponent of improving Israel's ties with Turkey.
Erdogan argues that having close ties with Hamas allows him to play a mediating role as well as counter Iran's influence on the group.
A Turkish official quoted by the Reuters news agency claims Ankara is working to win the release of more than a hundred Israelis held hostage by Hamas.
Presidential advisor Casin says Turkey is calling for Israeli restraint while expressing support for Netanyahu's demand to hold perpetrators of the Hamas attack to account.
"I am supporting Mr Netanyahu on this point. They have to catch and punish this criminal action according to their sovereignty, territorial integrity and self-defence rights," Casin says.
"After this, if they kill children and civilian people, this turns into a kind of ethnic cleansing and other criminal actions," he continues. "How can we explain to the public? I hope Netanyahu and Israeli people will take care and listen to our advice."
However, Israeli forces are stepping up their attacks on Gaza and appear to be preparing a ground assault.
"The Israeli war is going to be horrendous," warns Ozel. "We have not yet seen the pictures from Gaza about the deaths of men, women, elderly people and children that we have seen already coming out of Israel."
"This will put a lot of pressure on Erdogan, and that's why I think the language seems to be toughening up compared to the first day."
With the increase in protests against Israel – many supported by opposition parties – the pressure on Erdogan to harden his stance against Tel Aviv can only grow.