<p>A locking device for doors and the like, having a bolt installed in the door frame and movable into the open position by a solenoid and into the shut position by a spring. Locking devices of this kind have not found general use, since there is no room in the frame for a device as required by the regulations wherewith the lock may be opened mechanically from the inside. This problem has been solved in such a manner that the socket of the door has a counterbolt forced by a spring against the bolt proper, whereby the spring force of the spring of the counterbolt is smaller than the spring force of the spring of the bolt.</p>