From left, senior Fatah official Azzam al-Ahmed, head of the Hamas government Ismail Haniyeh and senior Hamas leader Moussa Abu Marzouq hold their hands after announcing a reconciliation agreement in Gaza City. (Suhaib Salem/Reuters)

Rival Palestinian political factions on Wednesday announced a surprise reconciliation deal and plans for a unified government, upending U.S.-backed peace talks with Israel just days before a deadline to end or extend the most substantive negotiations in years.

The deal would reunite the moderate Fatah faction in the West Bank, which has been negotiating with Israel, with the radical Hamas faction, which refuses to recognize Israel’s legitimacy. Hamas is blamed for allowing near-daily rocket attacks on Israel from the Gaza Strip territory it controls.

Israel quickly condemned the plan and canceled a negotiating session with representatives of Palestinian Authority President Mahmoud Abbas planned for Wednesday evening.

“This evening, as peace talks were about to take place, Abbas chose Hamas and not peace,” read a statement released by Israeli Prime Minister Benjamin Netanyahu’s office. “Whoever chooses Hamas does not want peace.”

The statement called Hamas “a murderous terror organization that calls for the destruction of Israel.”

The United States, apparently taken unawares, called the development disappointing and a serious hurdle to nine-month-old peace talks that have been the signature diplomatic effort of Secretary of State John F. Kerry.

“It’s hard to see how Israel can be expected to negotiate with a government that does not believe in its right to exist,” State Department spokeswoman Jen Psaki said.

Fatah and Hamas have announced similar accords previously, only to see them fall apart.

The accord announced Wednesday gives Abbas five weeks to form a unity government based on conditions laid out in previous agreements and to set in motion plans for parliamentary and presidential elections.

At a news conference in the Gaza Strip, Hamas leader Ismail Haniyeh and senior Fatah official Azzam al-Ahmad said the two factions had fulfilled a “national responsibility” to reach an agreement.

Fatah is the dominant party in the Palestine Liberation Organization and governs the much larger Palestinian territory in the West Bank under Israeli occupation. Fatah broke ties with the Islamist militant movement Hamas after it seized control of the smaller Gaza territory in 2007. Hamas had swept elections there in 2006, following Israel’s unilateral withdrawal of forces and settlers.

Both the United States and Israel have branded Hamas a terrorist organization and have no direct relations with the group.

The United States is watching developments closely, Psaki said, and is not yet writing off intensive efforts to help Israel and the Palestinians frame a peace deal.

“This could seriously complicate our efforts — not just our efforts, but the efforts between the parties, more importantly, to extend the negotiations,” Psaki said.

Kerry worked for the first half of 2013 to restart peace talks that had been largely shelved for the previous five years. When talks did resume last summer, he set a deadline of the end of April for an outline deal. That deadline had slipped, and efforts over the past several weeks were on keeping negotiations going. Kerry insists the talks have been detailed and meaningful, despite complaints on both sides. All talks have been at the relatively low level of negotiators, with no direct meeting between Netanyahu and Abbas.

“The ball is in the Palestinian court” to explain how the proposed unity government would work and what effect it would have on talks with Israel, Psaki said.

Abbas has said he wants a peace deal and has pledged to bargain with Israel in good faith. Netanyahu likewise has said he wants a deal.

Dore Gold, special adviser to Netanyahu, said the announcement reveals how Abbas really sees future relations with Israel.

“Unless Abbas pulls back from his embrace of Hamas, it’s impossible to imagine these peace talks will work,” Gold said.

Saeb Erekat, the chief Palestinian negotiator, suggested Israel is being hypocritical.

“Mr. Netanyahu and his government were using Palestinian division as an excuse not to make peace. Now they want to use Palestinian reconciliation as an excuse for the same purpose,” Erekat said. “This is utterly absurd. The only logical conclusion is that Netanyahu’s government does not want peace.”

Shimrit Meir, founding editor of Arabic media outlet Al Masdar, said that despite the announcement of an agreement between Fatah and Hamas, the real test would be if Abbas visits Gaza in the coming weeks.

“This is not the first ‘breakthrough’ between the two sides since 2007; we have been in this situation before,” she said, adding, however, that there were some indications that this agreement could hold.

This time, she said, both sides are in difficult positions. Both have lost their popularity on the Palestinian street, Hamas has lost its support from Egypt and Iran, and Abbas is facing difficult challenges in reaching a peace agreement with the Israelis.

“Hamas wants to implement this agreement because they are very weak and need it now more than any time in the past,” Meir said.

Abbas, she said, is indicating that he has made a choice to go with Hamas rather than trying to achieve a breakthrough in the peace process with Israel.

As the news conference in Gaza City was taking place, the Israeli military said that its jets had targeted sites in the seaside enclave. Palestinian media reported that seven people were injured.

Gearan contributed from Washington. Islam Abdul-Karim in Gaza contributed to this report.