By 880, power was transferred to the local Sino-Viet elites who governed in the name of Tang Empire. In 905, a leader named Khúc Thừa Dụ came to power as commissioner for Tĩnh Hải quân (Jinghai guan). The Khucs manipulated the Later Liang dynasty court in the north to maintain their own autonomy. In 930, emperor of Southern Han Liu Yan attacked Jinghai and removed the Khuc family from power. In late 931, Duong Dinh Nghe from Ai who was much less sinicized than the Khucs revolted and ousted Southern Han. However Duong Dinh Nghe was assassinated in 937 by a leader of a pro-Chinese faction bent on restoring the sinified leadership he had displaced. Ngo Quyen, son-in-law of Duong, quickly overthrew of the revanchist leaders and defeated the Southern Han fleet in the Battle of Bạch Đằng River in late 938. In 939, he claimed himself king (vua), and chose the ancient town of Co Loa as the court's capital. The Principality of Jinghai de facto became an independent state, and Vietnamese history comes into its own.