An engine speed control device for an engine , the engine speed control device at least comprising: an engine speed detecting means that detects an engine speed of the engine; a cooling water temperature detecting means that detects a temperature of a cooling water of the engine; a rack position detecting means that detects a rack position of a fuel injection pump; and a lubricating oil temperature detecting means that detects a lubricating oil temperature of the engine, wherein the engine speed control device performs a first PID gain calculation step of calculating a target engine speed to calculate a first PID gain based on an engine speed deviation between the target engine speed (Nm) and an engine speed (Nr) detected by the engine speed detecting means , a target rack position calculation step of correcting the first PID gain using a cooling water temperature correction factor based on a cooling water temperature (Tw) detected by the cooling water temperature detecting means to thereby calculate a target rack position of the fuel injection pump, a second PID gain calculation step of calculating a second PID gain based on a rack position deviation between the target rack position (Rset) and a rack position (Rr) detected by the rack position detecting means, and a rack control signal producing step of correcting the second PID gain using a lubricating oil temperature correction factor based on a lubricating oil temperature (Tp) detected by the lubricating oil temperature detecting means to thereby produce a rack control signal (Rfset), the engine speed control device controls the engine speed by controlling the rack position based on the rack control signal (Rfset), the cooling water temperature correction factor applied to correction of the first PID gain is not applied to correction of the second PID gain, and the lubricating oil temperature correction factor applied to correction of the second PID gain is not applied to correction of the first PID gain. an engine speed detecting means that detects an engine speed of the engine; a cooling water temperature detecting means that detects a temperature of a cooling water of the engine; a rack position detecting means that detects a rack position of a fuel injection pump; and a lubricating oil temperature detecting means that detects a lubricating oil temperature of the engine, wherein the engine speed control device performs a first PID gain calculation step of calculating a target engine speed to calculate a first PID gain based on an engine speed deviation between the target engine speed (Nm) and an engine speed (Nr) detected by the engine speed detecting means , a target rack position calculation step of correcting the first PID gain using a cooling water temperature correction factor based on a cooling water temperature (Tw) detected by the cooling water temperature detecting means to thereby calculate a target rack position of the fuel injection pump, a second PID gain calculation step of calculating a second PID gain based on a rack position deviation between the target rack position (Rset) and a rack position (Rr) detected by the rack position detecting means, and a rack control signal producing step of correcting the second PID gain using a lubricating oil temperature correction factor based on a lubricating oil temperature (Tp) detected by the lubricating oil temperature detecting means to thereby produce a rack control signal (Rfset), the engine speed control device controls the engine speed by controlling the rack position based on the rack control signal (Rfset), the cooling water temperature correction factor applied to correction of the first PID gain is not applied to correction of the second PID gain, and the lubricating oil temperature correction factor applied to correction of the second PID gain is not applied to correction of the first PID gain. <EOS>