Lock for a door or a window, in particular panic lock for use in escape routes and emergency routes, having a lock case having a lock mechanism mounted therein which has the following components and the following construction: a latch bolt which is moveably mounted in the lock case, wherein the latch bolt is moveable between a retracted first position in which the latch bolt is fully retracted into the lock case, an extended second position in which the latch bolt is partially extended out of the lock case, and an extended third position in which the latch bolt is extended far out of the lock case, - a first spring which urges the latch bolt into the extended third position, - an auxiliary latch, wherein the auxiliary latch is moveable between a retracted position in which the auxiliary latch is fully retracted into the lock case, and an extended position in which the auxiliary latch is extended out of the lock case, - a second spring which urges the auxiliary latch into the extended position, and - a slider which is moveably mounted in the lock case and is mechanically coupled to the latch bolt wherein it is provided that the lock has a holding member which is moveably mounted in the lock case, said holding member cooperating directly or indirectly with the auxiliary latch and being moveable between a blocking position, in which the holding member projects into the movement path of the slider and prevents a movement of the latch bolt from the extended second position into the extended third position, and a non-blocking position, in which the holding member is located outside of the movement path of the slider and permits the movement of the latch bolt from the extended second position into the extended third position, characterised in that the latch bolt and the auxiliary latch are moveably coupled in such a manner that, during movement of the latch bolt from its extended second position into its retracted first position, the auxiliary latch is directly or indirectly transferred into its retracted position by the latch bolt. a latch bolt which is moveably mounted in the lock case, wherein the latch bolt is moveable between a retracted first position in which the latch bolt is fully retracted into the lock case, an extended second position in which the latch bolt is partially extended out of the lock case, and an extended third position in which the latch bolt is extended far out of the lock case, - a first spring which urges the latch bolt into the extended third position, - an auxiliary latch, wherein the auxiliary latch is moveable between a retracted position in which the auxiliary latch is fully retracted into the lock case, and an extended position in which the auxiliary latch is extended out of the lock case, - a second spring which urges the auxiliary latch into the extended position, and - a slider which is moveably mounted in the lock case and is mechanically coupled to the latch bolt - a first spring which urges the latch bolt into the extended third position, - an auxiliary latch, wherein the auxiliary latch is moveable between a retracted position in which the auxiliary latch is fully retracted into the lock case, and an extended position in which the auxiliary latch is extended out of the lock case, - a second spring which urges the auxiliary latch into the extended position, and - a slider which is moveably mounted in the lock case and is mechanically coupled to the latch bolt wherein it is provided that the lock has a holding member which is moveably mounted in the lock case, said holding member cooperating directly or indirectly with the auxiliary latch and being moveable between a blocking position, in which the holding member projects into the movement path of the slider and prevents a movement of the latch bolt from the extended second position into the extended third position, and a non-blocking position, in which the holding member is located outside of the movement path of the slider and permits the movement of the latch bolt from the extended second position into the extended third position, characterised in that the latch bolt and the auxiliary latch are moveably coupled in such a manner that, during movement of the latch bolt from its extended second position into its retracted first position, the auxiliary latch is directly or indirectly transferred into its retracted position by the latch bolt.