CAIRO - The exiled leader of Hamas said on Wednesday that if Israel complied with a ceasefire in the Gaza conflict, Palestinians would as well but they would respond to any Israeli violation.

Earlier, Prime Minister Binyamin Netanyahu told US President Barack Obama he was ready to give the ceasefire a chance, but that "more forceful action" might be needed if it failed, according to a statement from his office.

Khaled Mashaal, leader of the Islamist Hamas, speaking in Cairo after the truce was announced by the Egyptians, said: "If Israel complies, we are compliant. If it does not comply, our hands are on the trigger."

At a news conference, Meshaal also thanked Egypt for helping mediate the Gaza ceasefire and praised Iran for providing Gazans with financing and arms.

"We have come out of this battle with our heads up high," he said, adding that Israel had been defeated and failed in its "adventure".

"It failed, praise be to God," Mashaal said of Israel's eight days of attacks on Gaza, which the Jewish state said were meant to stop increasing Palestinian rocket fire from the enclave targeting its cities and towns.

Meshaal said the deal to end fighting in Gaza stipulates that all of the Palestinian territory's crossings must be opened, disputing what he described as Israeli assertions to the contrary.

"The (ceasefire) document stipulates the opening of the crossings, all the crossings, and not just Rafah," Mashaal told a news conference in Cairo.

Israel controls all of Gaza's crossings apart from the Rafah border with Egypt.