A gate lock is composed of a lock base, a lock core with a slot defined therein, a latch member and a bolt assembly. A gate is mounted in a frame, which can be mounted in a doorway. The gate lock is mounted on the gate and the bolt assembly of the gate lock is mounted on the frame. When the gate is closed, the bolt is engaged in the slot in the lock core. The lock core is then rotated 90 degrees. The bolt will not slide out of the slot, and the gate is locked. To unlock the gate, the lock core is rotated 90 degrees in the opposite direction. The gate is then lifted upward allowing the bolt to slide out of the slot, thus enabling the gate to swing open.