Abstract: An automatic locking system includes a magnetic sensor and a magnet. The magnetic sensor sends a signal if the proximity to the magnet equals or is less than a predetermined distance. A controller drives a motor to extend a throw bolt in response to receiving the signal from the magnetic sensor. An electronic deadbolt includes the automatic locking system. The magnetic sensor is arranged in a deadbolt assembly inside the door on which the electronic deadbolt is arranged, and the magnet is arranged in or adjacent to a strike lining box on the door frame so the automatic locking system is hidden from view. An electronic deadbolt includes a master function that may be activated or deactivated by a user. If the master function is activated, a master passcode and master tag may be used to operate the electronic deadbolt and access programming buttons.