From the Han to the Tang, Vietnam lay under China's commandery rule (the millennium of Northern rule); in 938 Ngo Quyen broke the Southern Han on the Bach Dang river and made himself king (no dynasty formed), and in 968 Dinh Bo Linh quelled the 'twelve warlords' and founded Dai Co Viet as emperor - the start of Vietnam's independent dynasties: the Dinh, Early Le, Ly (from 1009, capital Thang Long from 1010), Tran (which thrice broke the Mongols, 1258, 1285, 1288 at Bach Dang), Ho (with the Ming interlude of 1407-1427), and the Later Le (restored by the Lam Son rising in 1428, the Hong Duc code of Le Thanh Tong). The state's names shifted - Dai Viet, Dai Ngu among them; the southward march swallowed Champa and opened the Mekong delta (Gia Dinh, 1698), Confucian examinations and the demotic nom script running side by side. The Tay Son rising (1771-1802) swept the Later Le away; in 1802 Nguyen Anh united the land and founded the Nguyen dynasty, closing the Dai Viet age.

Editorial note on dating Ngo Quyen won independence at Bach Dang in 938 (without founding a dynasty); Dinh Bo Linh proclaimed the empire in 968; the Dinh, Early Le, Ly, Tran and Later Le followed (Chinese rule 1407-27); replaced by the Nguyen in 1802.