A socket section 72 for providing a first light guide 13 is supported movably in an endoscope main body 4, and a plug section 62 for fixing a second light guide 15 is disposed in an endoscope insertion section 5. The socket section 72 is configured to move freely in an insertion direction of the endoscope insertion section 5 and to a direction orthogonal with respect to the insertion direction. Furthermore, an attachment-detachment-detecting switch 33 is disposed in the endoscope main body 4 so as to detect that the endoscope insertion section 5 has been separated from the endoscope main body 4 before the plug section 62 is freely detached from the socket section 72. By this configuration, it is possible to attach the endoscope insertion section from the endoscope main body and detach them easily and reliably, in particular, to reduce loss of light caused by the attachment and the detachment.