By Nick Thorpe
BBC, in Rafah, Egypt
Fearful of the power vacuum which could follow an Israeli withdrawal from the Gaza Strip, Egypt has been carving out a role for itself in Prime Minister Ariel Sharon's so-called disengagement plan.
The Egyptian soldier let out a cry, and began running towards us, gun in hand.
Behind him loomed the solid yellow wall of the Gaza border, and, jutting above it like the conning tower of a submarine, a heavily-fortified Israeli watch tower.
Israel will keep its grip on the Gaza-Egyptian border
My minders from the Egyptian Ministry of Information took several minutes to persuade the soldier that we had every right to be filming one of the most sensitive borders in the Middle East.
Egyptian Rafah is a small town of 14,000 inhabitants, compared to the better-known city of Rafah, with about 120,000, just across the border in Gaza.
Israeli officials frequently contend that Palestinian militants have dug a honey-comb of tunnels under the border, to smuggle weapons into Gaza from Egypt.
Local Egyptian officials shake their heads at the story.
"There aren't any tunnels here," said one. "The Palestinians buy their weapons from Israeli soldiers."
But I hadn't come to the border to investigate smuggling allegations. I just wanted to understand the importance of Gaza to the Egyptians.
Stung by criticism
Israeli Prime Minister Ariel Sharon appears determined to stick to his plan to dismantle all 21 Israeli settlements in the Gaza strip, and withdraw Israeli forces from Gaza next year - despite equally determined opposition from his own Likud party, and the settlers organisations, to stop him.
The proposal has provoked further disarray in the already chaotic Palestinian ranks, as different factions struggle for local power ahead of any pullout.
The Egyptian government meanwhile, afraid of a security vacuum in Gaza, and stung by American and European criticism that it is not pulling its weight in the region, has cautiously welcomed the Sharon plan.
And it has made concrete proposals of its own.
Palestinian security forces, ineffective and scattered by frequent Israeli incursions and targeted assassinations in Gaza, would be re-trained in Egypt.
And 150-200 Egyptian security advisers - read trainers and military intelligence agents - would be sent into Gaza.
Egyptian officials are quick to stress that they have no territorial ambitions - Egypt administered the Strip from 1949-67.
"Our interest is purely Palestinian. What we want is to secure law and order in Gaza," said Ambassador Hassan Issa, a former head of the Israel desk at the Egyptian foreign ministry, and former Egyptian consul in Eilat.
There is no question of Egypt just playing a security role, seen as tantamount to 'doing the Israeli's dirty work
"To get the Palestinian factions to deal with each other; to eliminate [sic] all these security organisations into three; train their personnel; and get this to be a first step towards another Israeli withdrawal, from the West Bank."
His conclusion - to turn any Israeli pullout from Gaza into a lever with which to re-launch the wider peace process - sounds ambitious.
But the Egyptians have some experience of dealing with Ariel Sharon too. And they're aware that what the Israelis really want them to do is to disarm militant Palestinian organisations like Hamas and Islamic Jihad which are very influential in Gaza.
Ambassador Issa says there is no question of Egypt just playing a security role, which in the eyes of the Arab world, and Palestinian and Egyptian public opinion, would be tantamount to "doing the Israeli's dirty work for them."
Egypt's Rafah is smaller, but no less deprived than its Gaza namesake
He views that as a trap.
"That's why, right from the start, we had our... very clear conditions.
The message to the Israelis is that they have to ensure that if the Egyptians go there, there are no incursions or assassinations.
"To the Palestinian organisations - we require unanimous agreement, clear cut, black and white approval and support for our presence there. Otherwise we don't go."
At the moment, that Palestinian approval looks a little easier to get than Israeli agreement to Egyptian conditions.
Despite the devastation that Israeli attacks have made on their leadership, Hamas are riding high on a new wave of popularity at home, and respectability abroad.
Egypt and the Palestinians have made progress in their meetings
Their remaining leaders are made more welcome in Arab capitals than before.
Khaled Meshaal, a senior Hamas official based in Syria, visited Cairo in August and September.
Other top Palestinian officials, from Palestinian leader Yasser Arafat's Fatah movement, and others, have followed.
The Egyptian intelligence chief, Omar Suleiman, runs the bilateral talks with the Palestinians, just as he frequently visits Ramallah for talks with Mr Arafat, and Jerusalem for talks with the Israelis.
There's no breakthrough yet, but the Egyptians and Palestinians are clearly hammering out a common position on Gaza. In that at least, they're far ahead of the Israelis.