Optical sensor for the surveillance of a surveillance space having at least one light transmitter for emitting transmission light into the surveillance space and at least one light receiver for measuring of light to be detected from the surveillance space, a one-piece light-guiding element being present for guiding of transmission light in the direction of the surveillance space and for guiding of light to be detected to the light receiver, the light-guiding element comprising: - an entrance surface for transmission light at which, in operation, transmission light enters into the light-guiding element, - a terminal surface at which, in operation, transmission light exits the light-guiding element in the direction of the surveillance space and at which light to be detected from the surveillance space enters into the light-guiding element, - a beam splitter surface with at least one transmission region and at least one reflection region which are arranged such that transmission light coming from the entrance surface is being guided to the terminal surface and light to be detected coming from the terminal surface is being guided, at least partially, on a beam path which is different from the beam path of the transmission light, - an exit surface for light to be detected at which, in operation, light to be detected coming from the beam splitter surface exits the light-guiding element, - at least one deflection surface with which light (15, 25), the beam path of which runs via the at least one reflection region, is deflected within the light-guiding element, and - a region with a light collecting effect for concentrating of light to be detected on the light receiver, characterized in that the light-guiding element is a molded plastic component, that the transmission region and the reflection region are spatially separated, that the deflection surface and the reflection region form an interface of the material of the light-guiding element to the ambient air, that an orientation of the deflection surface and of the reflection region is selected such that light to be passed on impinges at an angle at which total reflection occurs and that the region with a light collecting effect is formed out of the the exit surface by an outwardly bulged form. - an entrance surface for transmission light at which, in operation, transmission light enters into the light-guiding element, - a terminal surface at which, in operation, transmission light exits the light-guiding element in the direction of the surveillance space and at which light to be detected from the surveillance space enters into the light-guiding element, - a beam splitter surface with at least one transmission region and at least one reflection region which are arranged such that transmission light coming from the entrance surface is being guided to the terminal surface and light to be detected coming from the terminal surface is being guided, at least partially, on a beam path which is different from the beam path of the transmission light, - an exit surface for light to be detected at which, in operation, light to be detected coming from the beam splitter surface exits the light-guiding element, - at least one deflection surface with which light (15, 25), the beam path of which runs via the at least one reflection region, is deflected within the light-guiding element, and - a region with a light collecting effect for concentrating of light to be detected on the light receiver,