Turkey’s President Recep Tayyip Edrogan and his Egyptian counterpart, Abdel Fatah el-Sissi, united their efforts Wednesday in Cairo, calling for a halt to Israel’s looming offensive on a southern Gaza city in its war against Hamas.

Erdogan’s visit comes as ties between Ankara and Cairo are back on track after years of tensions and frosty relations. Turkey has long been a backer of the pan-Islamist Muslim Brotherhood group, which has been outlawed as a terrorist organization in Egypt.

The Turkish leader arrived in the Egyptian capital, his first visit to Cairo in over a decade, after visiting the United Arab Emirates on Tuesday, where he met with UAE President Sheikh Mohammed bin Zayed Al Nahyan.

Erdogan met with el-Sissi at Cairo’s Ittihadiya palace, according to Egypt’s state-run media. Their talks focused on bilateral relations and regional challenges, especially efforts to stop the war in Gaza, el-Sissi later said at a joint news conference.

“We agreed on the need for an immediate cease-fire (in Gaza) and the need to achieve calm in the West Bank” to relaunch Israeli-Palestinian peace talks with the ultimate goal of establishing an independent Palestinian state, el-Sissi said.

Egypt and Turkey fell out after the Egyptian military in 2013 ousted Islamist President Mohammed Morsi, who hailed from the Muslim Brotherhood, amid mass protest against his divisive one year of rule.

Over the past few years, Ankara abandoned its criticism of el-Sissi’s government as it tried to repair frayed ties with Egypt and other Arab heavyweights. In November 2022, Erdogan and el-Sissi were photographed shaking hands during the World Cup in Qatar.

The war in Gaza has reached a critical point, with an impeding Israeli offensive on the city of Rafah, along the Gaza Strip’s border with Egypt, where some 1.4 million people — over half the territory’s population — are crammed into tent camps and overflowing apartments and shelters.

Speaking at the news conference with el-Sissi, Erdogan urged Israel’s Prime Minister Benjamin Netanyahu to avoid a ground offensive in Rafah and accused the Israeli government of committing “massacres” in Gaza.

“Efforts to depopulate Gaza are not acceptable,” he said.

Egypt is concerned that a ground assault on Rafah would push hundreds of thousands of displaced Palestinians across the border and into Egypt’s Sinai Peninsula. It has threatened to suspend the country’s decades-old peace treaty with Israel.

Egypt, together with Qatar and the United States, a key Israel ally, has been working to try and broker a cease-fire and the return of the remaining 130 hostages held by Hamas, around a fourth of whom are believed to be dead. The negotiators held talks in Cairo on Tuesday but there were no signs of a breakthrough.

The war began with Hamas’ assault into Israel on Oct. 7, in which the militants killed about 1,200 people, mostly civilians, and abducted around 250. The overall Palestinian death toll in Gaza has now surpassed 28,000 people, according to the Health Ministry in Gaza, and a quarter of the territory’s residents are starving.

“Before the region is exposed to harsher threats, we need to stop the massacre in Gaza now,” Erdogan said at the World Governments Summit in Dubai on Tuesday.