The invention discloses an automatic lock, which comprises a lock case, a spring bolt component, a swing piece and a trigger component, wherein a locking part, which is arranged in a part in the lock case, is arranged on the spring bolt component; a swing shaft is arranged on a position, which is more biased to a lock-out direction than the locking part on a lock-in terminal position, and the swing piece is provided with a butting part; the spring bolt component is provided with a space, which is capable of further moving to the lock-in direction under the thrust of the trigger component, in the lock-in state; rotating partial pressure, which tends to rotate to the lock-out direction, is applied to the swing piece, and lock-out partial pressure, which is capable of pushing the spring bolt component out along the lock-out direction, is applied to the spring bolt component; self-locking pressure is formed between the locking part and the butting part on the lock-in position by the rotating partial pressure and the lock-out partial pressure. The automatic lock solves the technical problem of complicated structure of the automatic lock in the prior art, so that the automatic lock with the simple structure is further provided.