Indispensable in war, horses were of tremendous strategic importance to the rulers of Tang China. When the dynasty came to power in AD 618 only 5000 horses grazed in the pasturelands of Gansu province; by mid-century government efforts had increased their number to 706,000. Some fine horses came to China as tools of diplomacy - gifts presented to cement international alliances, both martial and marital. Others were imported from distant city-states like Samarkand and Bukhara, Kish and Kucha. Most, however, came from closer to home, bought and bartered from the Turkic peoples to the north. Prices were high. In the early 8th century, when official exchange markets were first set up, hundreds of thousands of bolts of silk were sent annually to the frontier; in the late 8th century, the Uighur Turks were demanding forty bolts for a single horse.
Horses received in trade were kept in vast pasturelands under government supervision until needed for service. Few, if any, went to the drudgery of farm labour. Horses were the preserve of the state and the aristocracy, forbidden as mounts to artisans and merchants. Some went to struggle valiantly on the battlefield, others to toil obscurely in the government post system. The best were selected for the imperial stables in the capital. There they served as mounts for the hunting parties and polo games of the aristocracy, as dancing entertainers to astonish guests at royal banquets and celebrations, and as imperial gifts bestowed upon favoured courtiers and deserving servants of the dynasty.