Gaza's Hamas Prime Minister Ismail Haniyeh, center, waves the Palestinian and Egyptian flags during celebrations of the victory of Mohammed Morsi in the Egyptian presidential elections, in Gaza City, Sunday, June 24, 2012. The Muslim Brotherhood victory in Egyptian presidential elections raises fears in Israel that the historic 1979 peace agreement with its southern neighbor is now in danger, a scenario that would have grave implications for regional security. But in the Hamas-ruled Gaza Strip, ecstatic residents flock to the streets, fire guns into the air and distribute candies in celebration, hopeful that Mohammed Morsi's election will usher in a new era for the blockaded seaside territory. (AP Photo/Hatem Moussa)

Gaza's Hamas Prime Minister Ismail Haniyeh, center, waves the Palestinian and Egyptian flags during celebrations of the victory of Mohammed Morsi in the Egyptian presidential elections, in Gaza City, Sunday, June 24, 2012. The Muslim Brotherhood victory in Egyptian presidential elections raises fears in Israel that the historic 1979 peace agreement with its southern neighbor is now in danger, a scenario that would have grave implications for regional security. But in the Hamas-ruled Gaza Strip, ecstatic residents flock to the streets, fire guns into the air and distribute candies in celebration, hopeful that Mohammed Morsi's election will usher in a new era for the blockaded seaside territory. (AP Photo/Hatem Moussa) (/ AP)

KARIN LAUB and IBRAHIM BARZAK, Associated Press

Gaza's euphoria over the election of a Muslim Brotherhood leader as Egypt's first Islamist president seemed a bit premature as reality set in the Monday.

Mohammed Morsi, the new Egyptian president, has close ties with Gaza's ruling Hamas, a branch of his region-wide Brotherhood. Over time, the Brotherhood's rise to power in the Arab world's leading nation could reshape the Palestinians' two long-running conflicts - with Israel over land and between Hamas and the rival Fatah movement of Western-backed Palestinian President Mahmoud Abbas over political supremacy.

For now at least, Morsi's ability to shift policy dramatically in favor of Hamas seems limited. It's unclear how much power Egypt's ruling generals will hand to the new president, and the country is beset by existential problems that demand his urgent attention, especially a crumbling economy.

The Brotherhood's priority is to be accepted as a political player in Egypt and the West, said Mideast analyst Mouin Rabbani. "They are not using their newfound status to actively support Hamas, whether in the conflict with Fatah or in the conflict with Israel," he said.

At the same time, Morsi's victory appears to hurt Abbas, who relied on Morsi's ousted predecessor, pro-Western President Hosni Mubarak, as an intermediary with Hamas, Israel and the West.

Regime change in Egypt hits Abbas at a time when he's increasingly isolated and irrelevant. Negotiations with Israel, reconciliation with Hamas and a bid to win U.N. recognition of a state of Palestine are frozen, while his self-rule government in the West Bank faces financial collapse.

When Egypt announced Sunday that Morsi edged out Ahmed Shafiq, a former prime minister under Mubarak, and would become the country's new president, spontaneous celebrations erupted in Gaza. Automatic rifle fire and shouts of "God is Great" reverberated across Gaza City, women threw candies at passers-by from balconies, and bikers waved Egyptian flags.

Gazans celebrated the hope that the Brotherhood would grant them freedom of movement, after five years of being cooped up in their tiny territory. The Hamas takeover in 2007 prompted Israel and Mubarak-led Egypt to seal Gaza's borders.

Israel eased the closure two years ago, allowing most imports of consumer goods, and Egypt's post-Mubarak interim government allowed more travel through the Rafah terminal on the Gaza-Egypt border. But many restrictions on travelers remained, and there was no talk about Gaza-Egypt trade. Instead, hundreds of smuggling tunnels tolerated by Egypt kept supplying Gaza with goods.

Ibrahim Derawi, an Egyptian analyst close to the Brotherhood, said he expects new border arrangements between Egypt and Gaza soon. Morsi "will not accept the siege on Gaza," said Derawi.

Morsi met several times over the past year with Hamas leaders from Gaza, most recently two months ago, said a senior Hamas official who spoke on condition of anonymity because of the sensitive nature of the contacts. He said Morsi promised to open Rafah 24/7, up from eight hours a day five days a week, and to be more flexible on visas.

Even so, major change is not in the cards, acknowledged the Hamas official who deals with border issues.

Egypt's security chiefs still consider Gaza a threat because of the ties between Gaza militants and al-Qaida-inspired groups in Egypt's Sinai next to Gaza. They have carried out attacks on Israeli targets and others in the desert. Travel restrictions on Gaza men under 40, considered the main potential pool of militants, would likely remain in place.

A complete opening of the Gaza-Egypt border, including trade, would also have the unintended consequence of deepening the separation between the West Bank and Gaza, which flank Israel but are supposed to be part of a single Palestinian state in the future, along with east Jerusalem. All three territories were captured by Israel in the 1967 Mideast war.

For more than a decade, Israel has restricted travel between the West Bank and Gaza, citing security.

Morsi's victory is expected to strengthen the hand of Hamas pragmatists, including the movement's supreme leader in exile, Khaled Mashaal who is seeking re-election and in recent months faced off against hard-line Hamas leaders in Gaza.

Mashaal wants Hamas to return to its ideological roots as a branch of the Brotherhood, which is open to alliances with non-Islamists and espouses non-violence.

Formed in Gaza in the late 1980s, Hamas adopted a militant ideology as part of its conflict with Israel, sending suicide bombers and other attackers into Israel, and in recent years has become increasingly beholden to anti-Israel Iran.

As part of the Arab Spring protests, the Brotherhood - hoping to become more attractive to a broader electorate in the region - has urged Hamas to moderate and make concessions in a power-sharing deal with Abbas that would lead to Palestinian elections to a unified government.

Hamas leaders in Gaza have balked, unwilling to give up power and perks amassed in the past five years in their separate administration.

Ahmed Yousef, a Gaza intellectual and supporter of Mashaal, said the Brotherhood would now have more leverage over the Gaza leadership. "Hamas in Gaza would listen carefully to what Egypt says, simply because they trust the new leaders in Egypt," he said.

The announcement of Morsi's victory, after 16 months of turmoil, is sending a strong signal that democratic transformation, however bumpy, is possible, said Mustafa Barghouti, an independent West Bank politician.

Inspired by Egypt's example, Palestinians will be more assertive and demand the same for themselves, said Barghouti. Elections in the West Bank and Gaza are three years overdue, and proponents say voting is the only way to heal the political split.