Gao Pian
During the Tang dynasty, northern Vietnam was put under Annan Protectorate from 679 AD to 866 AD. With its capital around modern Bắc Ninh, Annan became a flourishing trading outpost, receiving goods from the southern seas. Around the 7th century, the Vietic peoples (ancestors of the Vietnamese) probably migrated from the Annamites to the Red River Delta. From 858 to 864, Nanzhao army from Yunnan aided with local Vietnamese rebels attacked the Tang Annan and destroyed the Chinese army of 150,000. In 866, Chinese jiedushi Gao Pian recaptured the city and drove out the Nanzhao army. He renamed the city to Daluocheng (大羅城, Đại La thành).