A slewing control device for a working machine having a slewing body, comprising: an electric motor which slews the slewing body; an operation member ( 7r; 71) which is operable to output a slewing command including information corresponding to presence or absence of an operation by an operator, and information corresponding to a slewing direction and a slewing amount of the slewing body in response to the operation by the operator; a mechanical brake which is operable to be switched between a brake activated state in which the slewing body is held so that slewing of the slewing body is restricted, and a brake released state in which holding of the slewing body is released; and a brake circuit which is adapted to switch the mechanical brake between the brake activated state and the brake released state, characterized by a brake activation detecting member which detects whether the mechanical brake is in the brake activated state or in the brake released state; and a controller which controls the electric motor and the brake circuit, wherein the controller includes a control command generator which generates a control command for accelerating, decelerating, or stopping the electric motor, based on the slewing command from the operation member ( 7r; 71); a brake controller which outputs a release command for switching the mechanical brake to the brake released state when the operation member ( 7r; 71) is operated or an activation command for switching the mechanical brake to the brake activated state when the operation member ( 7r; 71) is not operated, and a judging section which judges whether the mechanical brake is in an inconsistent state which is the state that the mechanical brake is in the brake released state when the activation command is outputted, based on a command to be outputted from the brake controller and a detection result by the brake activation detecting member, and the control command generator outputs, to the electric motor, a command for obtaining a braking torque for holding the slewing body in a stopped state, if judging section judges that the mechanical brake is in the inconsistent state. an electric motor which slews the slewing body; an operation member ( 7r; 71) which is operable to output a slewing command including information corresponding to presence or absence of an operation by an operator, and information corresponding to a slewing direction and a slewing amount of the slewing body in response to the operation by the operator; a mechanical brake which is operable to be switched between a brake activated state in which the slewing body is held so that slewing of the slewing body is restricted, and a brake released state in which holding of the slewing body is released; and a brake circuit which is adapted to switch the mechanical brake between the brake activated state and the brake released state, characterized by a brake activation detecting member which detects whether the mechanical brake is in the brake activated state or in the brake released state; and a controller which controls the electric motor and the brake circuit, wherein the controller includes a control command generator which generates a control command for accelerating, decelerating, or stopping the electric motor, based on the slewing command from the operation member ( 7r; 71); a brake controller which outputs a release command for switching the mechanical brake to the brake released state when the operation member ( 7r; 71) is operated or an activation command for switching the mechanical brake to the brake activated state when the operation member ( 7r; 71) is not operated, and a judging section which judges whether the mechanical brake is in an inconsistent state which is the state that the mechanical brake is in the brake released state when the activation command is outputted, based on a command to be outputted from the brake controller and a detection result by the brake activation detecting member, and a control command generator which generates a control command for accelerating, decelerating, or stopping the electric motor, based on the slewing command from the operation member ( 7r; 71); a brake controller which outputs a release command for switching the mechanical brake to the brake released state when the operation member ( 7r; 71) is operated or an activation command for switching the mechanical brake to the brake activated state when the operation member ( 7r; 71) is not operated, and a judging section which judges whether the mechanical brake is in an inconsistent state which is the state that the mechanical brake is in the brake released state when the activation command is outputted, based on a command to be outputted from the brake controller and a detection result by the brake activation detecting member, and the control command generator outputs, to the electric motor, a command for obtaining a braking torque for holding the slewing body in a stopped state, if judging section judges that the mechanical brake is in the inconsistent state.