A work machine comprising: an engine; a hydraulic pump that is driven by the engine; a hydraulic operation unit that is driven by pressure oil discharged from the hydraulic pump; a motor generator that drives the hydraulic pump; an electrical storage device that transfers electric power with the motor generator; a load computing unit (21, 21A) that computes the load power of the engine; a vehicle body state management unit that manages a vehicle body state including the state of the electrical storage device; and a controller as a control unit that controls torque of the motor generator, wherein the controller includes: an engine target power computing unit that computes engine target power for limiting an increase rate and a decrease rate in the power of the engine on the basis of the load power computed by the load computing unit (21, 21A) and the vehicle body state managed by the vehicle body state management unit; a hydraulic power limitation unit that limits the power of the hydraulic pump on the basis of the engine target power computed by the engine target power computing unit; and an assist power limitation unit that limits the power of the motor generator on the basis of the engine target power computed by the engine target power computing unit, characterized in that the vehicle body state management unit has an electrical storage device management unit that computes a powering available amount for powering the hydraulic pump in the electrical storage device through the motor generator, and as the absolute value of the powering available amount computed by the electrical storage device management unit increases, the engine target power computing unit corrects an increase rate in the engine target power to be decreased. an engine; a hydraulic pump that is driven by the engine; a hydraulic operation unit that is driven by pressure oil discharged from the hydraulic pump; a motor generator that drives the hydraulic pump; an electrical storage device that transfers electric power with the motor generator; a load computing unit (21, 21A) that computes the load power of the engine; a vehicle body state management unit that manages a vehicle body state including the state of the electrical storage device; and a controller as a control unit that controls torque of the motor generator, wherein the controller includes: an engine target power computing unit that computes engine target power for limiting an increase rate and a decrease rate in the power of the engine on the basis of the load power computed by the load computing unit (21, 21A) and the vehicle body state managed by the vehicle body state management unit; a hydraulic power limitation unit that limits the power of the hydraulic pump on the basis of the engine target power computed by the engine target power computing unit; and an assist power limitation unit that limits the power of the motor generator on the basis of the engine target power computed by the engine target power computing unit, characterized in that the vehicle body state management unit has an electrical storage device management unit that computes a powering available amount for powering the hydraulic pump in the electrical storage device through the motor generator, and as the absolute value of the powering available amount computed by the electrical storage device management unit increases, the engine target power computing unit corrects an increase rate in the engine target power to be decreased. an engine target power computing unit that computes engine target power for limiting an increase rate and a decrease rate in the power of the engine on the basis of the load power computed by the load computing unit (21, 21A) and the vehicle body state managed by the vehicle body state management unit; a hydraulic power limitation unit that limits the power of the hydraulic pump on the basis of the engine target power computed by the engine target power computing unit; and an assist power limitation unit that limits the power of the motor generator on the basis of the engine target power computed by the engine target power computing unit, characterized in that the vehicle body state management unit has an electrical storage device management unit that computes a powering available amount for powering the hydraulic pump in the electrical storage device through the motor generator, and as the absolute value of the powering available amount computed by the electrical storage device management unit increases, the engine target power computing unit corrects an increase rate in the engine target power to be decreased.