Watch: Obama press conference on Gaza

An enduring stability between Israel and Palestinians is not in the near future and will require leaders on both sides of the generations-long dispute to take political risks for the sake of peace and prosperity, President Barack Obama said Wednesday.

But first, Obama said, a temporary cease-fire in place in the Gaza Strip must hold without being violated before it expires on Friday.

Wrapping up a day of meeting with African leaders, Obama responded to a reporter’s questions about ongoing negotiations in Cairo over how to maintain the tentative truce between Israel and the militant group Hamas that controls the Gaza Strip.

The president said Israel deserves to defend itself from a barrage of rockets from Gaza and terror tunnels that Hamas has dug into Israel. At the same time, however, he said the Palestinian people in Gaza need to have some confidence that they will be able to rebuild their communities, pursue prosperity and not feel walled off from the rest of the world.

To achieve both goals, “there are formulas available, but they are going to require risks on the part of political leaders, they will require a slow rebuilding of trust, which is obviously very difficult in the aftermath of the kind of violence that we have seen,” Obama told journalists. “So I don’t think we get there right away.”

He twice repeated that “I have no sympathy for Hamas,” which both the U.S. and Israel consider a terrorist organization.

Nearly 1,900 Palestinians have been killed in the latest outbreak of fighting between Israel and Hamas that began July 8. Sixty-four Israeli soldiers and three civilians inside Israel have also been killed.

Obama also said he has “great sympathy” for the Palestinian Authority, which is based in the West Bank city of Ramallah and is led by President Mahmoud Abbas, who over the last year participated in what was an ultimately failed push for enduring peace with Israel.

Obama called Abbas “sincere in his desire for peace,” but he said the Palestinian Authority appears to have been weakened by the violence and failure for a long-term resolution with Israel. He said the Palestinian Authority has shown itself to be responsible and has recognized the state of Israel, as part of its desire for a solution that would also give international recognition to a state of Palestine.

“The population in the West Bank may also have lost confidence or hope on how to move forward,” Obama said. “We have to rebuild on that as well.”

The peace process fell apart last April after nearly nine months of negotiations, in part after Abbas and Hamas agreed to build a new government together and give the Palestinian people a unified leadership for the first time in years. Israel angrily shelved the negotiations, saying it would not deal with a government that included Hamas.

Negotiators from Israel were meeting with a Palestinian delegation in Cairo for talks on extending the temporary cease-fire and trying to resolve underlying issues to broker a more lasting truce. Officials from the U.S., the United Nations and Mideast nations were helping foster the discussions, which began with both sides taking hard-line positions and much jockeying expected ahead.