In Tang dynasty (618–907) China, early in the reign of Emperor Xuanzong (r. 712–56), a severe locust infestation undermined the young sovereign's political legitimacy. When anomalous insect-wrought disasters compromised seasonal agrarian rhythms of state, the stability of the dynasty was imperiled. Given the widespread belief in the idea of tianren ganying, the cosmic resonance of heaven and man, many in court and country understood the plague of locusts as a scourge visited on humankind by a censorious heaven. Thus for newly enthroned Xuanzong to prove that he possessed sufficient virtue, that he possessed the mettle to be Son of Heaven, it was imperative that he successfully manage the swelling tide of insects. A fierce court debate ensued over how best to handle this ecological crisis. The passive camp maintained that if Xuanzong cultivated virtue, the crisis might be resolved of its own accord. Alternatively, proponents of a proactive approach, namely chief minister Yao Chong, urged Xuanzong to wage an aggressive campaign of extermination. With a combination of powerful rhetoric to persuade opponents to follow his proactive course of action and well-devised pragmatic measures to exterminate the locusts, Yao Chong ultimately won the day and quelled the infestation. In the process of the vigorous debate, many epiphenomena are brought to light: the push and pull between central and local authority, growing tensions between Han Chinese and ethnic minority subjects in the cosmopolitan multiethnic state, and the ideological conflict between Confucianism and Buddhism.