Egypt is actively preparing for a key role in the Gaza Strip after the planned pullout of Israeli settlers this month, with the future of the territory just as important for Egypt as it is to Israel, albeit for different reasons.
With an eye on maintaining stability in Gaza as a way of shoring up its own national security, Egypt is planning a significant military deployment along its northeast border with Gaza once the pullout ends.
Egypt's main concern is preventing the formation of an Islamist stronghold once Israel evacuates 8,000 settlers in its planned August 17 disengagement from the Gaza Strip, according to analyst Emad Gad, an expert on Israeli affairs at Cairo's Al-Ahram Centre for Political and Strategic Studies.
"In no way can Egypt have an Islamist state at its door," he said.
"With free and democratic elections, Islamists from (militant groups) Hamas and Islamic Jihad could become the majority, and they will be the majority in the absence of a massive need for aid and to improve living conditions."
Such a development could spell trouble for neighbouring Egypt, already well versed in the dangers of Islamic extremism.
Just last month, Egypt was struck at the heart of its tourism trade when three suicide bombers ripped explosions through the Red Sea resort town of Sharm el-Sheikh, killing at least 67 people.
The attacks came eight years after 62 people, including 58 foreign holidaymakers, were killed in an attack in the southern Nile city of Luxor that was claimed by the Islamist militant group Jamaa Islamiyya.
So when Egyptian President Hosni Mubarak's regime looks at the planned Israeli pullout, "it is vital to avoid any Islamist contagion between Egypt and Gaza," said Mustafa Kamal el-Sayyid, political science professor at American University of Cairo.
Equally essential is "showing Egyptian public opinion and the Arab world (that) for Egypt the pullout is not an end in itself but only the first step toward a Palestinian state," he added.
Egypt struck a deal with Israel to boost post-pullout security by installing 750 soldiers along its border with Gaza, a territory Egypt administered after the 1948 war when 180,000 Palestinians took refuge there.
Following several military incursions, Israel subsequently occupied the Gaza Strip during the Six-Day War in 1967.
The border deployment is to begin September 1, marking the first time its forces will monitor the area since a 1979 peace deal between Egypt and Israel put an end to 30 years of hostilities and five wars.
The troops are to patrol the 13-kilometre-long border (eight miles), known in Egypt as the Salah al-Din corridor after the famous 12th century Kurdish conqueror, which has become riddled with arms-smuggling tunnels.
But while Israelis fear Gaza could again become a base for attacks, Egypt has already begun taking steps to make sure chaos does not erupt.
Last Wednesday, 34 Egyptian officers arrived in Gaza to help "rehabilitate" Palestinian security forces, which critics have blasted as disorganised and unprepared for the pullout.
And for the second time in as many months, Egypt's deputy intelligence chief Mustafa al-Buheiri intervened in mid-July to help restore a troubled seven-month-old truce, locking himself in meetings with Hamas, representatives of most armed groups and the governing Fatah party.
But according to analyst Diaa Rashwan, a researcher at Cairo's Al-Ahram Center, Egypt is also playing a delicate balancing game between security and diplomacy.
While he said the situation in Gaza is "very important for Egyptian national security," he does not think Islamists aim to "form their state (in Gaza) or provoke chaos."
Larger political challenges remain ahead, as Palestinians remain deeply wary that Israel will try to use the pullout from Gaza, the lesser part of their promised future state, to silence calls for a withdrawal from the larger West Bank.
"Egypt cannot forget that after Gaza comes the West Bank... Gaza and the West Bank are linked. Their future is together," said Rashwan, adding "Egypt will never play the dividing role that Israel would like it to play.
"Everyone accepts us in Gaza, Islamists included, because our message is clear: policy is more important than security," he said.