District magistrates (zhixian 知縣) were the lowest full officials of the local administration in the Ming 明 (1368-1644) and Qing 清 (1644-1911) periods. The title came up during the Tang period 唐 (618-907). In cases when the office of magistrate (then called xianling 縣令, see ling 令) was not filled, a deputy person was to take over his duties, "knowing the affairs of district X" (zhi mou xian shi 知某縣事).
The office itself was institutionalized during the early Song period 宋 (960-1279). The duties of the magistrate during that time were "instruction of the people", levying taxes, and caring for law and order. For this purpose, household registers and tax registers were to be made, granaries established, a disaster relief programme scheduled, and methods to levy taxes and demand corvée labour (see yaoyi 徭役). Magistrates were also responsible for military garrisons in their district, and for the supervision of jails.
During the Yuan period 元 (1279-1368) magistrates were called xianyin 縣尹, yet under the Ming, the term zhixian became the official designation for the administrator of the lowest territorial unit of the empire. The duties remained the same, namely registering the populations, levying taxes, arresting bandits, dispensing justice, and running schools. The term "paternal official" (fumu guan 父母官) was therefore occasionally used. The official rank of district magistrates was not fixed in the beginning, but depended on the tax quota of the district. It ranged from 6B to 7B. Later on it was equally fixed at rank 7A. The position was a test for talent in administration, and the best magistrates were recruited for service in the central government. This feature vanished in the later part of the Ming period. Regarding the great responsibility district magistrates had for the administration of a huge population, their status was not very high.