To prevent an actuator from protruding from a door when the door is opened in a safety switch.
In a safety switch 1, a protruding piece 3 provided in an actuator 10 is constituted to be movable, and a control lever 5 to move the protruding piece 3 along a movement direction of the door and a main body case 7 to house the protruding piece 3 at a retreat position are provided. Based on operation of the control lever 5 by an operator, the protruding piece 3 is protruded and moved from an insertion port 21 and is made engageable with a rotation cam 23. Meanwhile, when a retreating operation to retreat the protruding piece 3 from the insertion port 21 is conducted, the protruding piece 3 is retreated outside a safety switch body 20 and the engagement state is released. In this disengagement state, the protruding piece 3 can be moved to the retreat position.