This dissertation proposes a new framework for understanding changing Chinese ideas about barbarians (Yi-Di) and barbarism during the Tang (618-907) and Song (960-1276) periods. Much previous scholarship has drawn a sharp contrast between what is characterized as a "cosmopolitan" early Tang period (618-755) and the growing xenophobic ethnocentrism ascribed to the late Tang (756-907) and Song periods. I argue that this view underestimates the importance of ethnocentric tropes in early Tang political rhetoric and also overlooks the emergence of a new and arguably less ethnocentric interpretation of the classical Chinese-barbarian dichotomy in the late Tang and Song. This new interpretation originated as a rhetorical trope in the ninth century before developing into a true philosophical concept in the eleventh, the key figures in this process being the polemicist Han Yu (768-824) and the Daoxue moral philosophers (or "Neo-Confucians"). The new interpretation of the Chinese-barbarian dichotomy was characterized by a fluid, shifting boundary between Chineseness and barbarism, predicated on Classicist ("Confucian") moral standards rather than ethnic, racial, or geopolitical boundaries. Modern historians have termed this interpretation of Chinese identity as "culturalism," on the assumption that it was centered on "culture" instead of "race," and have followed Han Yu and the Daoxue philosophers in identifying Confucius himself as its originator. My dissertation revises this picture by demonstrating that the so-called "culturalist" interpretation was the product of a new discourse on ideological orthodoxy and morality that involved representing any deviation from Classicist values as a descent into barbarism. The core of this new discourse was thus an attempt at making Classicist ideology and morality (not "culture" per se) essential to the definition of Chinese ethnic identity, but its users also generally chose not to undermine their ethnic identities by acknowledging the possibility that barbarians could become Chinese by becoming good Classicists. The resulting tension or dilemma between moralistic and ethnocentric understandings of barbarism remained unresolved until the Mongol conquest of the Southern Song (1127-1276) led to the ethnocentric understanding's temporary eclipse.