Hamas on Thursday agreed to join a temporary Gaza ceasefire requested by the United Nations on humanitarian grounds.