The Palestinian reconciliation accord brokered by Egypt means as much to Cairo as the rival factions it united, because it signals a clear shift in Middle East policy from the era of deposed President Hosni Mubarak.
By pushing Fatah and its Islamist rival Hamas to end their feud, the generals who now rule Egypt are seeking to gain leverage over Israel, cosy up to regional rival Iran and gain credibility among a largely pro-Palestinian population.
Egypt also shares a border with Gaza, the tiny coastal enclave which Hamas rules, and an accord that ends Palestinian infighting would mean a more secure frontier, analysts said.
"Cairo has a number of interests in this deal and the provisional military authority played a lead role in the intra-Palestinian deal," said Kamran Boukhari, Middle East analyst with Stratfor Global Intelligence consultancy.
"Egypt does not wish to see turmoil in Gaza at a time when it is engaged in a transition on the home front. It appears also that Egypt is trying to assert itself vis-a-vis Israel."
Egypt is the most populous Arab country, but its regional influence was seen to fade after three decades of Mubarak's rule, during which foreign policy was solidly aligned with the United States but increasingly distant from popular sentiment.
Egypt signed a peace accord with US ally Israel in 1979, but many Egyptians remain hostile to their neighbour due to its occupation of Arab land seized during the 1967 Arab-Israeli war.
Israel was worried that Mubarak's overthrow by pro-democracy activists could mean an end to peace, but one of the first announcements made by the ruling generals was to reinforce the accord.
Shortly afterwards, the military-appointed government reached out to Iran, Israel's arch-enemy and the main backer of Hamas, saying the time was ripe for better ties.
Egypt also appears to have coordinated with Iran its efforts to bring Hamas and Fatah together, a sign of further closeness.
"The Iranian foreign minister's praise of the deal indicated Tehran is backing the reconciliation," Boukhari said.
"And since Iran has signed off and Hamas is headquartered in Damascus it means Syria also decided to allow the reconciliation to go through."
Mubarak, not Egyptian, policy
Egypt's foreign policy over the past 30 years was seen as the private domain of the staunchly pro-American Mubarak.
A vehement opponent of Islamist groups, Mubarak tried to suppress the opposition Muslim Brotherhood and quashed an armed Islamist uprising in the 1990s.
He survived an assassination attempt in Addis Ababa in 1995.
"The policy against Hamas and the close alliance with the United States and Israel stemmed from the Mubarak administration's attempt to prioritise personal interests ahead of national ones," said a senior Egyptian official involved in policy making.
"Mubarak was busy with internal affairs, such as engineering the succession of his son Gamal. This characterised his administration's policy," the official said.
Since Mubarak's resignation on 11 February, the interim military rulers have steered foreign policy away from Mubarak's legacy to show that Egypt now wants to slowly but surely expand its alliances and restore its status as a regional power.
Military intelligence supervised the Hamas-Fatah accord, and Egypt said it would send a security team to Gaza soon to implement the agreement.
The council allowed two Iranian warships to pass through Egypt's Suez Canal in February despite loud objections from Israel and the disapproval of Washington.
Egyptian Foreign Minister Nabil al-Araby reached out earlier this month for closer diplomatic ties with Iran that were severed in the early days of the Islamic Republic when Egypt was forging ahead with peace with Israel.
Egypt's intelligence service has also eased the movement of Palestinians from Hamas-ruled Gaza over its Gaza border.
After Mubarak's ouster, the government has put on trial several officials in his administration over corruption, including a former energy minister over allegations of selling natural gas to Israel below market prices.
On Wednesday, hours before the Palestinian accord was signed, saboteurs blew up the gas pipeline, which also supplies Jordan and local industries.
"The army believes a more balanced Egyptian foreign policy is necessary and that Egypt still has a key regional role that it may have lost track of previously but can regain," said Safwat Zayat, a military analyst.