Following years of tense relations, Israel and Turkey are inching toward an apparent agreement that could result in normalized relations. The primary stumbling block to reuniting the important Middle Eastern economic powers, however, has revolved around the Gaza Strip, which Turkish President Recep Tayyip Erdoğan would like to see opened to the world — or at least to Turkish aid agencies.

But as a deal nears, Turkey’s top regional rival, Egypt, has expressed worry to Israeli officials over Ankara's potential reach into the region, Haaretz reported Thursday.

Egyptian officials are concerned a role for Turkey in Gaza, which borders Egypt’s restive Sinai province, could threaten its own security. While analysts said the agreement was likely to support regional peace, they also said the deal, depending on its conditions, could also be seen in Egypt as lending power to a top adversary, as well as causing security concerns by propping up Islamist forces.

”President Erdoğan and President [Abdel-Fattah] el-Sissi are the hottest enemies in the Middle East, and it has not ebbed at all,” said Paul Salem, vice president for policy and research at the Middle East Institute, a Washington think tank, referring to the Turkish and Egyptian leaders. “Inviting Erdoğan to get a foothold in Gaza — of course the Egyptians are going to be very much against it.”

Erdogan gaza Palestinian youths take part during a rally in support of Turkish Prime Minister Recep Tayyip Erdogan (seen on banner), at the Seaport of Gaza City, June 18, 2013. Photo: Reuters/Suhaib Salem

How much of a fight Egypt is willing to put up regarding a deal between Turkey and Israel might well depend on how an agreement pans out, Middle East analysts said. Erdoğan has said he will demand an easing of the blockade on Gaza, which Israel and Egypt say is necessary to prevent radical groups in Gaza, like the Islamist movement Hamas, which governs the territory, from obtaining weapons. Palestinians and human rights organizations have argued the blockade has unfairly hurt civilians in Gaza where some 80 percent of the population now relies on humanitarian assistance.

”Turkey is determined to not accept any sort of restriction on Turkish assistance to Gaza,” the Turkish Hurriyet Daily News said, quoting an anonymous senior government official.

Relations soured between Israel and Turkey more than five years ago when Israeli commandos raided a Turkish aid ship headed toward Gaza with the goal of breaking the blockade. Nine people — including eight Turkish nationals — were killed in that incident, and Turkey has demanded compensation ever since.

Although trade relations have continued to be strong, Turkey and Israel have been locked in a diplomatic battle. In 2011, Ankara expelled the Israeli ambassador. President Recep Tayyip Erdoğan has come to be known for his fiery condemnations of Israeli policies toward the Palestinians, and Israeli officials have accused Turkey of supporting Hamas. As part of an agreement, Turkey would have to expel Salah al-Arouri, a high-profile Hamas official based in Turkey.

When tensions first erupted,  Erdoğan was portrayed as a model Muslim leader throughout much of the Middle East as Turkey's economy boomed and the country boasted good relations with all of its Arab neighbors. He sought to champion traditional Muslim causes such as the Palestinian issue. But that has changed in recent months as Turkey has been embroiled in conflict and has seen its economy shrink. A deal between Israel and Egypt likely reflected a weakening of Erdoğan's regional ambitions, Salem said.

”Erdoğan is struggling to find a place where he can have some power, and I think he's swallowing some bitter pills by repairing his relations with Israel, but perhaps if he can regain a presence in Gaza that can be his prize,” he said.

But as tense as Turkey's relations with Israel have been, ties between Egypt and Turkey have been even worse. Erdoğan, who is an Islamist, has contested Sisi's right to rule after he toppled President Mohamed Morsi, who was aligned with the Muslim Brotherhood and whose rule led to widespread street protests. Turkey has demanded Morsi be reinstated as president, and Egypt has criticized Turkey for its support and sheltering of Muslim Brotherhood leaders, whom it considers terrorists. Egypt views any role for Turkey in Gaza as bolstering the Muslim Brotherhood, to which the ruling Islamist government in Gaza — Hamas — favors, analysts said.

”The Sisi regime considered that Hamas was working with insurgent groups in the Sinai,” said David Schenker, who previously served as an adviser to the secretary of defense, and now is the director of the program on Arab politics at the Washington Institute for Near East Policy in Washington.

Israel has repeatedly sought to have Egypt take on a greater role in Gaza, but according to Schenker, Egyptian leaders have largely shunned the responsibility. Instead, its leaders have imposed a heavy closure on the border, cutting off underground tunnels used to smuggle goods and weapons in and out of Gaza.

”Egypt doesn't want to have any part of it. They'd rather other states ... but they don't see Turkey as a productive, moderate player,” he said. ”They view them as Islamist and ideological, so they would be concerned that the Turkish role would bolster the popularity of Hamas in Gaza.”

mashaal Turkish President Tayyip Erdoğan (right) meets with Hamas leader Khaled Meshaal in Istanbul, Turkey, Dec. 19, 2015, in this handout photo provided by the Presidential Palace. Photo: Reuters/Kayhan Ozer/Presidential Palace/Handout via Reuters

The connection between Hamas and insurgents in Egypt's Sinai region remains murky. Fighting picked up after the Muslim Brotherhood government was deposed, and Hamas officials, or at least members, have been accused of supporting that insurgency although Hamas too opposes those affiliated with the Islamic State group in the Sinai. Hamas has denied involvement in fighting in the Sinai.

For Egypt, Gaza is primarily a matter of national security, said Brenda Shaffer, a senior fellow at the Atlantic Council in Washington, who has researched the Middle East.

"Gaza is not some issue abroad for Egypt, or some island. Gaza borders Sinai,” Shaffer said. 

Relations between Egypt and Israel, as well as shared concerns, are likely strong enough that Israel will consider Egyptian security before agreeing to any deal with Turkey, Shaffer said.

”I'm not sure that Israel, beyond something symbolic, would allow Turkey to have a role in Gaza,” she said. ”Egypt borders Gaza, so it's a legitimate security interest of Egypt.”

gaza strip A Palestinian woman, hoping to cross into Egypt, stands behind a fence as she waits at the Rafah crossing between Egypt and the southern Gaza Strip, Dec. 22, 2014. Photo: Reuters/Ibraheem Abu Mustafa

Salem, of the Middle East Institute, said he saw some irony in recent events. For years, American leaders struggled to bring Egyptian and Israeli leaders to the table, following decades of animosity between the two countries, which included several wars. Now, both countries communicate over security and have strong relations, but remain somewhat critical of the U.S. government.

”Some Americans say they succeeded beyond our wildest dreams. They don't even talk to us, but they talk to each other,” he said.