An emergency stop apparatus for a working machine, comprising: a detecting device for detecting an obstacle intruding into a predetermined area around a working machine; an actuator fixable to a vehicle body (200, 300) of the working machine or a member attached to the vehicle body (200, 300); a coupling member for coupling an output shaft of the actuator and a brake pedal; an electronic control unit for actuating the actuator and moving the brake pedal in an actuation direction of a service brake when the obstacle is detected by the detecting device; and characterised in that the actuator is a power cylinder and the emergency stop apparatus further comprises: a member to be detected mounted on an output shaft of the power cylinder; and at least one sensor (820, 830) for detecting the member to be detected, the at least one sensor (820, 830) fixable to the vehicle body (200, 300) of the working machine or a member attached to the vehicle body (200, 300) such that an actuation area of the power cylinder defines at least one of a state in which the output shaft is contracted and the service brake is released, and a state in which the output shaft is extended and the service brake is actuated; wherein the actuation area of the power cylinder can be changed arbitrarily by mounting the at least one sensor (820, 830) to positions adapted for the characteristics of the working machine; and wherein the electronic control unit controls the actuation of the power cylinder in response to an output signal of the at least one sensor (820, 830). a detecting device for detecting an obstacle intruding into a predetermined area around a working machine; an actuator fixable to a vehicle body (200, 300) of the working machine or a member attached to the vehicle body (200, 300); a coupling member for coupling an output shaft of the actuator and a brake pedal; an electronic control unit for actuating the actuator and moving the brake pedal in an actuation direction of a service brake when the obstacle is detected by the detecting device; and characterised in that the actuator is a power cylinder and the emergency stop apparatus further comprises: a member to be detected mounted on an output shaft of the power cylinder; and at least one sensor (820, 830) for detecting the member to be detected, the at least one sensor (820, 830) fixable to the vehicle body (200, 300) of the working machine or a member attached to the vehicle body (200, 300) such that an actuation area of the power cylinder defines at least one of a state in which the output shaft is contracted and the service brake is released, and a state in which the output shaft is extended and the service brake is actuated; wherein the actuation area of the power cylinder can be changed arbitrarily by mounting the at least one sensor (820, 830) to positions adapted for the characteristics of the working machine; and wherein the electronic control unit controls the actuation of the power cylinder in response to an output signal of the at least one sensor (820, 830). a member to be detected mounted on an output shaft of the power cylinder; and at least one sensor (820, 830) for detecting the member to be detected, the at least one sensor (820, 830) fixable to the vehicle body (200, 300) of the working machine or a member attached to the vehicle body (200, 300) such that an actuation area of the power cylinder defines at least one of a state in which the output shaft is contracted and the service brake is released, and a state in which the output shaft is extended and the service brake is actuated; wherein the actuation area of the power cylinder can be changed arbitrarily by mounting the at least one sensor (820, 830) to positions adapted for the characteristics of the working machine; and wherein the electronic control unit controls the actuation of the power cylinder in response to an output signal of the at least one sensor (820, 830).