Handheld machine tool comprising a machine housing , a tool holder for holding a tool, an electric motor , a shaft which connects the tool holder and the electric motor , and a protection device for stopping the tool holder in the case of an uncontrolled situation, wherein the protection device contains: a sensor for identifying the uncontrolled situation, a switchable power source which, in response to signals of the sensor , outputs a first current (I1), which is different from zero, when an uncontrolled situation is not identified and which does not output any current or outputs a second current , which is different from the first current (I1), when an uncontrolled situation is identified, and a normally-closed magnetic brake which acts on the shaft and, when energized with the first current (I1), does not exert any torque onto the shaft and, when not energized or energized with the second current , exerts a torque which counters the rotational movement of the shaft , characterized in that the magnetic brake has a brake shoe , which is arranged in a stationary manner in the machine housing , and a brake disc , which can be rotated relative to the brake shoe about the axis of the shaft and can be displaced along the shaft between a freewheeling position and a braking position, wherein the magnetic brake has a permanent magnet and a magnet coil , and wherein the permanent magnetic field , which is generated by the permanent magnet , and the magnetic field , which is generated by the magnet coil through which the first current flows, are antiparallel, and wherein the brake shoe and the permanent magnet are arranged in a closure direction of the brake disc , which closure direction extends from the freewheeling position to the braking position. a sensor for identifying the uncontrolled situation, a switchable power source which, in response to signals of the sensor , outputs a first current (I1), which is different from zero, when an uncontrolled situation is not identified and which does not output any current or outputs a second current , which is different from the first current (I1), when an uncontrolled situation is identified, and a normally-closed magnetic brake which acts on the shaft and, when energized with the first current (I1), does not exert any torque onto the shaft and, when not energized or energized with the second current , exerts a torque which counters the rotational movement of the shaft , characterized in that the magnetic brake has a brake shoe , which is arranged in a stationary manner in the machine housing , and a brake disc , which can be rotated relative to the brake shoe about the axis of the shaft and can be displaced along the shaft between a freewheeling position and a braking position, wherein the magnetic brake has a permanent magnet and a magnet coil , and wherein the permanent magnetic field , which is generated by the permanent magnet , and the magnetic field , which is generated by the magnet coil through which the first current flows, are antiparallel, and wherein the brake shoe and the permanent magnet are arranged in a closure direction of the brake disc , which closure direction extends from the freewheeling position to the braking position. <EOS>