To defeat the people's uprisings, in the later half of the 8th century, Zhang Boyi (張伯儀), a Tang dynasty viceroy, built Luocheng (羅城, La Thanh or La citadel, from Thu Le to Quan Ngua in present-day Ba Dinh precinct). In the earlier half of the 9th century, it was further built up and called Jincheng (金城, Kim Thanh or Kim Citadel). In 863, Nanzhao army and local people 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 (大羅城, Đại La thành). He built the wall, 6,344 meters around the city, which some part were more than 8 meters high. Đại La at the time with approximate 25,000 residents included small foreign communities and residents of Persians, Arabs, Indian, Cham, Javanese and Nestorian Christians, became an important trading center of the Tang dynasty due to the ransacking of Canton by Huang Chao rebellion. By early 10th century AD, modern-day Hanoi was known to the Muslim traders as '''Luqin'''.