Hamas said on Saturday it had agreed a truce with Israel in the Gaza Strip, a day after clashes killed an Israeli soldier and four Palestinians along the border.