In 1802, Nguyen Anh defeated the Tay Son, ascended the throne, known as Emperor Gia Long, the first king of Nguyen Dynasty. Gia Long set up the capital in Hue. Thang Long was later changed to Northern Citadel Chief including eleven towns. Nguyen Dynasty then assigned and empowered the Northern Citadel Chief. They also set Taos, as the representative agencies of ministries in Thang Long. Northern Citadel Chief was entitled to appointment and dismisal of mandarins, trial litigation. He could report to the king after conducting all these procedures. Therefore, the government in Thang Long – Northern Citadel at that time was almost a miniature court. This shows that Nguyen Dynasty still heightened the importance of Thang Long.
King Gia Long ordered to demolish Thang Long Forbidden Citadel and rebuild a new square citadel, mimicking the French Vauban style. Each side was arranged with two forts; each corner had a corner fort. The outer wall had seven doors; above each door, there were a building and copper columns. Around the citadel, the mort system was conducted with water from To Lich River. The bridges over the mort were built with burnt bricks. Wall bottom was about 28m wide; wall surface was about 8m wide. On the surface of the wall, smaller walls were built for the military to hide and shoot down during the war.
King Gia Long also ordered to build another palace behind Kinh Thien Palace as the royal step-over palace and Southeast, Southwest, East, West and North gates. In front of the old Thang Long Imperial Citadel, King Nguyen built the flag tower, called Dien Dai, 100 meters high.
In 1820 July, King Minh Mang added a number of constructions in Thang Long. He built more palaces, royal step-over paths and posting houses for mandarins from Kinh Bac up to Lang Son to receive Chinese envoys. In front of Kinh Thien Palace, King Minh Mang built Thi Trieu and Can Chanh Palaces. In the southern bank of Nhi river, built tiled houses to welcome envoys; in the northern bank, set seven embassy stations from Gia Quat to Lang Son. In the middle of the stations, a tiled house was built; the buildings in front, behide or besides were built with low-quality wood and tiled with straw grass.
In 1931, King Minh Mang implemented a large-scale administrative reform. The positions of Northern Citadel and Gia Dinh Thanh Chiefs was abrogated. King Minh Mang divided the country into 30 provinces directly under the unified rule of the court. The chief town of Northern Citadel, including Thang Long Imperial Citadel of the previous dynasties and the expansion, was named Ha Noi Province. Then, Ha Noi included 4 urban districts, i.e. Hoai Duc, Thuong Tin, Ung Hoa and Ly Nhan, 15 districts, i.e. Tho Xuong, Vinh Thuan, Tu Liem, Thuong Phuc, Thanh Tri, Thanh Oai, Chuong Duc, Son Minh, Hoai An, Nam Xang, Duy Tien Binh Luc, Phu Xuyen, Kim Bang and Thanh Liem.
Under the reign of previous Nguyen Kings, Hanoi Province Citadel was 1.728m in perimeter with the height of 4.5 m; the moat around was about 16m wide. Under the reign of King Minh Mang, the citadel was made shorter in accordance with the regulations of the province.
Thus, during Nguyen Dynasty, though the imperial city was Hue, but Thang Long – Hanoi still existed as a large center of politics, economy, culture and society, highly respected by the court.