CAIRO - Rival Palestinian factions Fatah and Hamas on Wednesday proclaimed a landmark reconciliation pact aimed at ending their bitter four-year rift that has left them divided between separate governments in the territories envisioned for a future Palestinian state.

The alliance set off ecstatic celebrations in the Palestinian territories. But Israel's leader called the presence of Hamas in the government a "big prize for terrorism," while Mideast envoy Tony Blair said the Palestinians would have to take a moderate stance toward Israel or risk international isolation.

Palestinian President Mahmoud Abbas brushed off the criticism and instead used the occasion to deliver a scathing attack on Israel. "We forever turn the black page of division," Abbas told the declaration ceremony in the Egyptian capital, Cairo. He promised to "soon" the visit Hamas-held Gaza Strip.

The Palestinians have been torn between rival governments since a previous unity arrangement collapsed into civil war in June 2007. In five days of fighting, Hamas overran the Gaza Strip, leaving Abbas' Palestinian Authority in charge of the West Bank. Reconciliation is essential for Palestinian dreams to establish a state in the two areas.

Wednesday's pact provides for the creation of a joint caretaker government ahead of national elections next year. But it leaves key issues unresolved, such as who will lead the government or control the competing Palestinian security forces.

It also makes no mention of relations with Israel -- the issue that led to the collapse of the previous unity government. Abbas favors a negotiated peace with Israel, while Hamas refuses to accept Israel's existence.

In a potential sign of trouble, Blair said the world would demand the new government renounce violence and recognize Israel's right to exist -- something that Hamas has always refused to do. Despite an informal cease-fire that ended Israel's punishing invasion two years ago, hundreds of rockets have been fired at Israel from Hamas-ruled Gaza.

"If the principles are not upheld, it puts us in a very difficult position," he told The Associated Press. "I think the central question people ask is, 'Does this mean a change of heart on behalf of Hamas or not?' ... We want them in this process. Otherwise there will be no peace."

Blair represents the so-called quartet of Mideast mediators -- the United States, European Union, United Nations and Russia -- which imposed identical conditions to the previous Palestinian government. Hamas' refusal to accept these conditions could jeopardize hundreds of millions of dollars in international aid.

Hamas leader Khaled Mashaal told the ceremony in Cairo that his group was prepared to do anything to "translate the text of the pact to facts on the ground. Our battle is with the Israeli enemy and not with Palestinian factions."

Ahead of the ceremony, Abbas aide Nabil Shaath called the international demands "unfair."

Israel denounced the pact because of Hamas' long history of suicide attacks and rocket fire against Israeli targets. Israel, the U.S. and the European Union all consider Hamas a terrorist group.

"What happened today in Cairo is a mortal blow to peace and a big prize for terrorism," Prime Minister Benjamin Netanyahu said during a trip to London. "Israel continues to want peace and seek peace but we can only achieve that with our neighbors that want peace. Those of our neighbors that seek the destruction of Israel and use terrorism are not partners to peace."

British officials said they were waiting for more details, but expressed hope the agreement would boost the peace process. Earlier this week, Foreign Secretary William Hague said the U.K. would "judge a future Palestinian government by its actions and its readiness to work for peace."

In his speech, Abbas rejected Israel's opposition to the pact, saying the reconciliation was an internal Palestinian affair. "They are our brothers and family. We may differ, and we often do, but we still arrive at a minimum level of understanding," Abbas said.

In a message to Israel, Abbas added: "We reject blackmail and it is no longer possible for us to accept the occupation of Palestinian land."

Peace talks broke down more than seven months ago with the expiration of an Israeli freeze on West Bank settlement construction. Abbas says he will not restart talks until Israel stops building homes on occupied lands claimed by the Palestinians.

With peace talks stalled, Abbas is focusing on internal Palestinian issues. A unified government will also make it easier for him to carry out his plan to seek UN recognition of a Palestinian state, with or without a peace deal, in September.

Hamas and other Palestinian militant factions in Gaza have agreed to abide by an unofficial truce with Israel, largely in place since Israel's January 2009 war in the territory. But it is unclear how long that truce will last, and Hamas has often looked the other way while smaller militant groups fired rockets into Israel.

The unity deal set off celebrations in both the West Bank and Gaza -- where residents reacted with a mix of excitement and caution.

In Gaza City, motorists honked their horns and waved yellow Fatah flags, which had been banned for the past four years. Other people held placards of Fatah's iconic leader, the late Yasser Arafat, or hugged Hamas policemen.

"I am so excited. Today is a day of joy for all Palestinians," said Narmine Talal, a 24-year-old student who waved a small Fatah flag. Talal handed out candy from her car window to a police officer, as her father drove.

In the West Bank town of Ramallah, where the Palestinian Authority is headquartered, several hundred people, mostly Fatah supporters, rallied in the central Manara Square, raising Palestinian flags and calling for unity. "The people want to end the split," they cried.

Saleh Mashni, a 66-year-old pharmacist, said he put the chances of success at "fifty-fifty."

"I want to be an optimist, but I can't. It's difficult," he said, expressing concern that Hamas could resume its attacks on Israel.

In a symbolic step, Hamas allowed Fatah-controlled Palestine TV to broadcast from Gaza for the first time since the 2007 takeover, while Hamas' al-Aqsa TV was permitted to broadcast from Ramallah.

"Today we end a dark chapter in our recent history," Hamas leader Ismail Radwan told the Fatah TV station. "It's time now to work together."