The invention discloses an electronic lock capable of being automatically locked, which comprises a lock shell, a lock core module and a shifting sheet, wherein the lock core module comprises an electronic drive part and a mechanical transmission part, and the electronic lock capable of being automatically locked is characterized in that: the mechanical transmission part comprises a lock core installation seat, a lock core cover plate, a drive block, a push block and a limiting column, the drive block is connected with a return block in a clamping way, a first return spring is arranged between the return block and the lock core installation seat, the electronic drive part comprises a motor, a drive shaft of the motor is fixedly provided with a square rotating shaft, the rotating shaft passes through the push block to be connected with the limiting column in a plugging way, the push block is provided with a mechanical return device, the front part of the lock core installation seat is provided with a vertical staircase through hole, a clamping pin is arranged inside the staircase through hole, a second return spring is arranged between the clamping pin and the staircase through hole, the limiting column is provided with a radial limiting hole, and the shifting sheet is sleeved on the front end part of the lock core installation seat. The electronic lock capable of being automatically locked has the advantages that: when the electronic drive part of the electronic lock stays at a power-off state, the entire electronic lock can be automatically reset to lock, so the safety and reliability of the electronic lock can be improved.