Turkish President Recep Tayyip Erdogan urged Palestinians to unite amid Israel's war in Gaza following hours-long talks with Hamas chief Ismail Haniyeh in Istanbul on Saturday, his office said.
It was the first meeting between Erdogan and a Hamas delegation headed by Haniyeh since Israel began its military offensive in the Gaza Strip.
Haniyeh's visit to Turkey took place three days after he met Turkish Foreign Minister Hakan Fidan in Doha.
Erdogan said Palestinian unity was "vital" following the talks at the Dolmabahce palace on the banks of the Bosphorus strait, which Turkish media reports said lasted more than two and a half hours.
"The strongest response to Israel and the path to victory lie in unity and integrity," Erdogan said, according to a Turkish presidency statement.
As fears of a wider regional war grow, Erdogan said recent events between Iran and Israel should not allow Israel to "gain ground and that it is important to act in a way that keeps attention on Gaza".
NATO member Turkey has denounced Israel's offensive in Gaza following Hamas' October 7 attack on Israel and called for an immediate ceasefire.
Israeli Foreign Minister Israel Katz condemned the meeting, writing on X, formerly Twitter: "Muslim Brotherhood alliance: rape, murder, desecration of corpses and the burning of babies. Erdogan, shame on you!"
In response, Oncu Keceli, spokesman for the Turkish foreign ministry wrote on X: "It is the Israeli authorities who should be ashamed. They have massacred nearly 35,000 Palestinians, most of them women and children."
With Qatar saying it will reassess its role as a mediator between Hamas and Israel, Erdogan sent Foreign Minister Hakan Fidan to Doha on Wednesday in a new sign that he wants a role.
"I will continue as long as God gives me my life, to defend the Palestinian struggle and to be the voice of the oppressed Palestinian people," the president said Wednesday when he announced Haniyeh's visit.
Hamas has had an office in Turkey since 2011, when Turkey helped secure the agreement for the group to free Israeli soldier Gilad Shalit.
Turkey first broke relations with Israel following a deadly attack by Israeli commandos on a peace flotilla led by Turkish boats in international waters in 2010, that led to the killing of ten unarmed activists.
Erdogan has maintained links with Haniyeh, who has been a frequent visitor.
Fidan was a past head of Turkish intelligence and the country provided information and passports to Hamas officials, including Haniyeh, according to Sinan Ciddi, a Turkey specialist at the Foundation for Defense of Democracies in Washington.
This has never been confirmed by Turkish authorities, however.
If Qatar withdraws from mediation efforts, Turkey could seek to increase its profile based on its Hamas links.
Fidan on Saturday held talks with visiting Egyptian Foreign Minister Sameh Shoukry, with both men emphasising the need to deliver more humanitarian aid to devastated Gaza where the threat of famine looms.
Erdogan also met with Shoukry late Saturday, the Turkish Presidency said in a statement, where he said it was "essential for Islamic countries to work together" to "prevent the entire region from falling into a spiral of conflict".
Turkey is one of Gaza's main humanitarian aid partners, sending 45,000 tonnes of supplies and medicine in the region.
Israel has said it is preparing an offensive against the Gazan city of Rafah and the reported Israeli attack on the Iranian province of Isfahan, following Iran's direct attack on Israel, has only clouded hopes of a peace breakthrough.
But Erdogan can only expect a "very limited" role because of his outspoken condemnation of Israel and its actions in Gaza, Ciddi told French news agency AFP.
Last year, the Turkish leader likened the tactics of Israeli Prime Minister Benjamin Netanyahu to those of Nazi leader Adolf Hitler and called Israel a "terrorist state" because of its deadly offensive against Gaza.
Ciddi said Erdogan would not be welcome in Israel and at most might be able to pass messages between Palestinian and Israel negotiators.
The unprecedented Hamas attacks resulted in the deaths of 1,170 people in southern Israel, according to Israeli figures.
Israel's offensive has killed 34,049 people in Gaza, mostly women and children, according to the territory's health ministry.
AFP, Reuters, and The New Arab's 2022 article 'Turkey tightens restrictions on Hamas members, deports dozens: officials' by Sally Ibrahim contributed to this piece.