The Imperial Guards of the Tang dynasty, also known as the Forbidden Troops (), were initially honor guards of the emperor and garrisons of the imperial capitals during the Tang's formation in the early 7th century. After the An Shi Rebellion, which lasted from AD 755 to 763, the Imperial Guards became the only military force that remained under direct control of the Tang court. The Pioneers The dynasty's founder was an aristocrat based in present-day Taiyuan, and was an experienced soldier from his tenure as border commander. He launched his bid for power in AD 617 with only 30,000 troops, and by the time he defeated his rivals, he commanded more than 200,000 troops. About 30,000 volunteered to remain in service after general demobilisation; they became the pioneers of the Tang's hereditary Imperial Guards, and were assigned the fertile lands in the region of Bai irrigation canal, north of the Wei River, which had been abandoned during the turmoils of the Sui-Tang transition wars. This body became known as the Pioneer Forbidden Guards (元从禁军). The first body of the Imperial Guards were designated as bodyguards of the emperor, and would garrison the capitals and palaces. The mainstay of the empire's defence would be the fubing system, which assigned lands to farmers in return for periods of military service. Introduction of new Guard units In the beginning of the reign of Emperor Taizong, the monarch stationed a hundred soldiers skilled in archery at the northern gate of the palace. They became known as the Hundred Riders (百骑), and accompanied the emperor during his hunting excursions. In addition, seven companies of soldiers selected after trials of strength and skills were installed under the Northern Bureau (北衙) as additional bodyguards. Gradually, other new units were added and stationed around the palace, their members chosen from upper class of societies who met the selection criteria of physical appearance, skills and strengths. Yü Lin (Feathered Forest) and Long Wu (Dragon Martial) Guards In AD 662, Tang's third emperor transferred some outstanding horsemen, archers and footmen of the fubing army into the new Yü Lin (羽林, literally Feathered Forest) unit, and assigned them the duties of standing guard during Court sessions as well as imperial processions. The Hundred Riders unit was expanded by Empress Wu to Thousand Riders (千骑), then further increased by Emperor Zhongzong to Ten Thousand Riders (万骑). This unit was instrumental in