Lý Thái Tổ, its founder, began it in 1010 and finished it early in 1011, and it stayed the royal seat until 1789, when the Tây Sơn dynasty moved the capital to Huế. Little of the palace city stands today, but the Central Sector, made up of the Hanoi Ancient Citadel and the excavations at 18 Hoàng Diệu Street just to the east, was inscribed as a UNESCO World Heritage Site on July 31, 2010.

The site goes back further than Thăng Long itself: in 866 the Tang general Gao Pian ordered the Đại La Citadel built here. The Lý capital was laid out in three rings, with the defensive outer wall, the Imperial City within it and, at the heart, the Forbidden City, aligned on a north–south axis according to geomantic principles. In 1805 Gia Long had the old citadel cut down in size and its outer wall rebuilt in the Vauban style, and under French rule most of it was cleared for offices and barracks, sparing only the North Gate and the Flag Tower.

The Main Gate, Đoan Môn, was the southern entrance to the Forbidden City: five stone gateways, of which the central one was kept for the emperor and the two next to it for royalty and senior officials. The standing gate dates from the Lê dynasty, with a palace-style pavilion added on its upper terrace by the Nguyễn, and in 2002 archaeologists found a Trần-dynasty carriageway paved with Lý bricks beneath it. Beyond it lay Kinh Thiên Palace, the throne hall, of which only the foundations and their stairways survive. The front flight, the "Dragon Steps", has 10 steps split into three by two stone dragons carved in 1467, regarded as masterpieces of early Lê sculpture.

Other survivors include the Rear Palace, Hậu Lâu, built by the Nguyễn to house concubines; the North Gate, whose north face is scarred by cannon fire from the battle for the citadel in 1882; and the Hanoi Flag Tower, 33.4 m high, raised in 1812 on the foundation of a Lê-dynasty outer gate and now part of the Vietnam Military History Museum. From 1954 to 1975 the citadel was the headquarters of the People's Army of Vietnam, and Building D67, put up in 1967 to look like an ordinary house, hides a 60-centimeter soundproof wall and an escape tunnel. It is now a museum showing equipment used by the Politburo and the Central Military Commission during the war.

At 18 Hoàng Diệu Street, where the old Ba Đình Hall once stood, excavations exposed layer upon layer of the city's past: remains of the Đại La citadel from Tang times, foundations and decoration from the Lý and Trần dynasties, traces of Lê palaces and structures from the Nguyễn citadel. Large quantities of ceramics used in daily palace life through many periods came to light as well.