What is Hamas, the group Israel just agreed to stop fighting in Gaza?

Is Hamas an army? A government? A terrorist organization? The answer is: all of the above.