CAIRO // No one had expected Egypt's landmark peace treaty with Israel to hold forever, unchanged and diligently observed, when Anwar Sadat and Menachem Begin signed the document in 1979.
But few expected that the pact, which brought down the curtain on decades of animosity and ruinous wars, would come under so much pressure so soon after Hosni Mubarak was deposed in February.
Egypt's upheaval is spilling over into a cornerstone of the country's foreign policy - peace with Israel - when the Middle East is changing rapidly.
Since Mr Mubarak was removed, the Palestinians have seemingly given up on peace talks with Israel and are seeking recognition of their statehood at the United Nations.
Turkey's relations with Israel have deteriorated badly and Syria's Bashar Al Assad is facing a stubborn uprising.
But the prospect of Egypt and Israel going to war or the treaty being repealed looks remote.
However, there are calls in Egypt for the treaty to be renegotiated to allow the government to deploy more troops in the Sinai Peninsula, and to end the commitment to sell oil or gas to the Jewish state.
The military indirectly assured Israel early on, saying Egypt would honour all its international commitments.
But the interim prime minister, Essam Sharaf, created a stir this month when he told Turkish television that the treaty was not sacred and could be revised.
Israel's foreign ministry summoned the Egyptian ambassador to seek clarification of Mr Sharaf's comments.
In Cairo, a foreign ministry official reiterated his country's commitment to the treaty, but the incident showed how nervous Israel has become about its pact with Egypt.
The treaty was the first between the Jewish state and an Arab nation, paving the way for Jordan's pact with Israel in 1994 and setting in motion a series of Arab-Israeli peace negotiations.
It also sealed a dramatic rapprochement between Egypt and the US, which followed Cairo's break with the Soviet Union. Since then, Egypt has been the recipient of billions of US aid, the second largest American assistance package after Israel's.
Since the military took over seven months ago, the country's relations with Israel have been repeatedly put to the test.
It started with Egypt allowing two Iranian naval vessels to sail through the Suez Canal on their way to Syria in February.
Israel's alarm was compounded by Egypt's overtures to Iran over bilateral relations, with both countries expressing interest in restoring full diplomatic relations more than three decades after the Islamic Revolution.
Nothing concrete has come of the Egyptian-Iranian flirtation but the positive talk between the two Muslim nations continues to rattle the Israelis and the US.
A reconciliation agreement between the Palestinian rival factions Fatah and Hamas, signed in Cairo in the summer and resulting in plans for a coalition government, have angered Israel, which sees Hamas as a terrorist group.
Egypt under Mr Mubarak had for years sought to unite the Palestinian factions.
That effort was influenced by the regime's distrust of Hamas and its support of the western-backed Fatah and its leader, Mahmoud Abbas, president of the Palestinian Authority.
That the deal was signed so soon after Mr Mubarak's removal meant that Cairo was making decisions without paying much heed to Israel and the US.
Egypt also backs the Palestinians' bid for recognition as a state in the UN, going against the wishes of Israel and the US.
A border incident in August in which six Egyptian soldiers were killed in what Israel said was a mistake soured relations further.
Israel apologised for the deaths but this did not calm the indignation of many Egyptians, who claimed that Israel can do as it pleases and gets away with it.
The prime minister's office stoked the anger over the incident, which began with a cross-border raid in which eight Israelis were slain by militants.
He issued and then withdrew a statement saying Egypt was pulling its ambassador out of Israel.
The anger boiled over on the streets two weeks ago when a mob reached the Israeli embassy on the top two floors of a high-rise building in Cairo.
Much has been written and said about how 30 young protesters reached the embassy's offices and what really happened is being investigated - but the incident has prompted the country's military rulers to restore emergency laws and arrest dozens of suspects.
When the incident began, the demonstrators were left alone to demolish a security wall outside the high-rise. In many ways, the Israeli embassy protest pointed to more than just the state of relations between the two nations, but also to the situation in Egypt when many are becoming increasingly distrustful of the military's ability to handle the transition to democratic rule.
The protest at the Israeli embassy could be seen as a message to the military that while they rule, they cannot emulate the ways and policies of Mr Mubarak, who accorded Israel special treatment.
A sign of how relations between the two countries have changed is reflected in one of the charges lodged against Mr Mubarak: that he sanctioned selling Israel natural gas at prices lower than those prevailing on world markets.
His oil minister, Sameh Fahmy, is also on trial over the gas deal with Israel.