(Adds Obama quotes)
By Matt Spetalnick
WASHINGTON, Aug 6 (Reuters) - President Barack Obama on Wednesday backed Egyptian efforts to broker a durable Israel-Hamas ceasefire in Gaza but also called for a longer-term solution that provides for Israeli security while offering Gaza residents hope they will not remain "permanently closed off from the world."
Obama said the short-term U.S. goal is to make sure that a 72-hour truce holds and is extended beyond its Friday deadline, including the cessation of cross-border rocket fire by the Palestinian Islamist group Hamas, which controls the Gaza Strip.
While condemning Hamas as "extraordinarily irresponsible" for launching rockets from population centers, Obama urged an eventual "formula" to ease hardships of ordinary Palestinians who have suffered in the latest conflict. Israel maintains a Gaza blockade that is supported by neighboring Egypt on the strip's southern border.
"Long term, there has to be a recognition that Gaza cannot sustain itself permanently closed off from the world and incapable of providing some opportunity - jobs, economic growth - for the population that lives there," Obama said at the end of a summit hosting African leaders in Washington.
The Gaza truce held through its second day on Wednesday, and Israel said it was ready to extend the deal as Egyptian mediators pursued talks with Israelis and Palestinians on an enduring end to a war that devastated the enclave.
"We intend to support the process that's taking place in Egypt," Obama said.
"The question then becomes: can we find a formula in which Israel has greater assurance that Gaza will not be a launching pad for further attacks ... but at the same time ordinary Palestinians have some prospects for an opening of Gaza so that they do not feel walled off?" he said.
Obama said there was a need to begin the rebuilding process in Gaza, though he stopped well short of calling for an end to the blockade there - something Hamas has demanded but which Israel has long resisted, citing security concerns.
Obama repeated his support for U.S. ally Israel's "right to defend itself" but also reiterated his "distress" at the loss of civilian life in Gaza.
In an apparent message to hawkish Israeli Prime Minister Benjamin Netanyahu, Obama also backed a negotiating role for Palestinian President Mahmoud Abbas's mainstream Palestinian Authority, which governs in the West Bank. Its rival, Islamist Hamas - which vows Israel's destruction - rules the Gaza Strip.
He said Abbas was "sincere in his desire for peace" and his support for a two-state solution to the decades-old conflict, but that his leadership had been weakened by the Gaza crisis.
"My hope is that we'll be engaging with them to try to move what has been a very tragic situation over the last several weeks into a more constructive path," Obama said.
Obama, whose administration has failed to make headway in Middle East peacemaking since taking office, said reaching a broader Gaza deal would require leaders on both sides to take risks and acknowledged that any progress would be slow.
"I don't think we get there right away," he said. "But the U.S. goal right now would be to make sure that the ceasefire holds." (Additional reporting By Arshad Mohammed; Editing by Bernard Orr, Ken Wills and Clarence Fernandez)