A multiple-optical-axis photoelectric sensor in which a plurality of input signal lines for inputting setting signals are provided, an operation mode is set in accordance with a connection state of each of the input signal lines to a high-level power supply line or a low-level power supply line, and an output is stopped in response to detecting an object or occurrence of an abnormality, the multiple-optical-axis photoelectric sensor comprising: a first detection circuit that, taking at least one input signal line as a monitoring target, is configured to output an on-state detection signal upon detecting that a level of voltage applied to the monitored signal line is a high level, and to output an off-state detection signal when not detecting that the level of voltage applied to the monitored signal line is a high level; a second detection circuit that is configured to output an on-state detection signal upon detecting that the level of the voltage applied to the monitored signal line is a low level, and to output an off-state detection signal when not detecting that the level of the voltage applied to the monitored signal line is a low level; a memory in which on/off states of the detection signals from the first and second detection circuits (201, 202) are registered; registration setting means configured to register, in an initialization process in which the setting of the operation mode is permitted, the on/off states of each detection signal in the memory on the condition that the on/off states of the detection signals from the first and second detection circuits (201, 202) are unequal, to determine the connection state of the monitored signal line based on these on/off states, and to set the operation mode in accordance with the connection state of the monitored signal line; and abnormality detection means configured to monitor the detection signals from the first and second detection circuits (201, 202) after the registration in the memory has been completed, and to determine that an abnormality occurs in the connection state of the monitored signal line when at least one of the detection signals assumes a state that is different from the states registered in the memory. a first detection circuit that, taking at least one input signal line as a monitoring target, is configured to output an on-state detection signal upon detecting that a level of voltage applied to the monitored signal line is a high level, and to output an off-state detection signal when not detecting that the level of voltage applied to the monitored signal line is a high level; a second detection circuit that is configured to output an on-state detection signal upon detecting that the level of the voltage applied to the monitored signal line is a low level, and to output an off-state detection signal when not detecting that the level of the voltage applied to the monitored signal line is a low level; a memory in which on/off states of the detection signals from the first and second detection circuits (201, 202) are registered; registration setting means configured to register, in an initialization process in which the setting of the operation mode is permitted, the on/off states of each detection signal in the memory on the condition that the on/off states of the detection signals from the first and second detection circuits (201, 202) are unequal, to determine the connection state of the monitored signal line based on these on/off states, and to set the operation mode in accordance with the connection state of the monitored signal line; and abnormality detection means configured to monitor the detection signals from the first and second detection circuits (201, 202) after the registration in the memory has been completed, and to determine that an abnormality occurs in the connection state of the monitored signal line when at least one of the detection signals assumes a state that is different from the states registered in the memory.