stylistic:style_transfer, structural:summarization
Protectorate of Annam

By the year 679, the Tang dynasty changed the region's name to Annan (Chinese: 安南; Vietnamese: An Nam; "pacified south"), with Songping as its capital.

In the latter half of the eighth century, Zhang Boyi, a viceroy from the Tang dynasty, built Luocheng (Chinese: 羅城; Vietnamese: La Thành) to suppress popular uprisings. Luocheng extended from Thu Le to Quan Ngua in what is now Ba Đình district. Over time, in the first half of the ninth century, this fortification was expanded and renamed as Jincheng (Vietnamese: Kim Thành). In 863, the kingdom of Nanzhao, as well as local rebels, laid siege of Jincheng and defeated the Chinese armies of 150,000. In 866, Chinese jiedushi Gao Pian recaptured the city and drove out the Nanzhao and rebels. He renamed the city to Daluocheng (Chinese: 大羅城; Vietnamese: Đại La Thành). He built a wall around the city measuring 6,344 meters, with some sections reaching over eight meters in height. Đại La at the time had approximately 25,000 residents, including small foreign communities of Persians, Arabs, Indian, Cham, Javanese, and Nestorian Christians. It became an important trading center of the Tang dynasty due to the ransacking of Guangzhou by the Huang Chao rebellion. By early tenth century AD, modern-day Hanoi was known to the Muslim traders as Luqin.