Hamas said on Tuesday that a long-term truce to end seven weeks of fighting in Gaza had been agreed with Israel, hailing it as a "victory for the resistance."