The practice of conducting a periodic census began in Egypt in the second millennium BC, where it was used for tax gathering and to determine fitness for military services.