A jun was a historical administrative division of China from the Zhou dynasty (c. 7th century BCE) until the early Tang (c. 7th century CE). It is usually translated as a commandery or a prefecture in different eras of Chinese history.
During the later Zhou's Spring and Autumn period from the 8th to 5th centuries BCE, the larger and more powerful of the Zhou's vassal states—including Qin, Jin and Wei—began annexing their smaller rivals. These new lands were not part of their original fiefs and were instead organized into counties (xiàn). Eventually, jun were developed as marchlands between the major realms. Despite having smaller populations and ranking lower on the official hierarchies, the jun were larger and boasted greater military strength than the counties.
As each state's territory gradually took shape in the 5th- to 3rd-century BCE Warring States period, the jun at the borders flourished. This gave rise to a two-tier administrative system with counties subordinate to jun. Each of the states' territories was by now comparatively larger, hence there was no need for the military might of a jun in the inner regions where counties were established. The border jun's military and strategic significance became more important than those of counties.
Following the unification of China in 221 BCE under the Qin Empire, the Qin government still had to engage in military activity because there were rebels from among the six former states who were unwilling to submit to Qin rule. As a result, the First Emperor set up 36 jun in the Qin Empire, each subdivided into counties. This established the first two-tier administrative system known to exist in China.
When the Han dynasty triumphed over Chu in 206 BCE, the Zhou feudal system was initially reinstated, with Emperor Gao recognizing nearly independent kings and granting large territories to his relatives. These two sets of kingdoms were placed under hereditary rulers assisted by a chancellor (xiàng). Parallel to these, some Qin jun were continued, placed under a governor appointed directly by the central government.
Over the first three centuries CE, during the Eastern Han dynasty and Three Kingdoms period, the jun were subordinated to a new provincial division, the zhōu. Based upon legendary accounts of the Yellow Emperor's Nine Provinces, there were usually 13 zhōu and many more jun.
During the following five centuries, during the Jin and Southern and Northern Dynasties period, the number of administrative districts were increased and a three-tier system—composed of provinces, jun, and counties—was established. To limit the power of any one local lord, China was divided into more than 200 provinces, 600 jun, and 1,000 counties. Each province consisted of two or three jun and each jun had two or three counties under its jurisdiction.
After the Tang was established in 618, the former jun became prefectures but were referred to as zhōu. Emperor Xuanzong reversed these changes during his reign from 712 to 756. From then on, the term jun was no longer used in the administrative division system. After Emperor Suzong ascended the throne in 756, he changed commanderies back to prefectures.
When Taiwan was under Japanese rule, senior officials in charge of administrative subdivisions were known as junshous from 1920 to 1945. By the end of 1945, there were 51 jun in Taiwan.
In the Warring States period, the chief administrative officers of the areas were known as jun administrators (郡守, jùnshǒu). In the Han dynasty, the position of junshou was renamed grand administrator (太守, tàishǒu). Both terms are also translated as "governor". A grand administrator drew an annual salary of 2,000 dan (石) of grain according to the pinzhi (品秩, pǐnzhì) system of administrative rank. Many former grand administrators were promoted to the posts of the Three Ducal Ministers or Nine Ministers later in their careers.