Hanoicapital, from 1976, of Vietnam; capital, 1954–76, of North Vietnam; and former capital of French Indochinacity, capital of Vietnam. The city is situated in northern Vietnam on the western bank of the Red River, about 85 miles (140 km) inland from the South China Sea.

The region around modern present-day Hanoi was settled in prehistoric times, and the location was often chosen as a political centre by Chinese conquerors. In 1010 Ly Thai To, the first ruler of the Ly dynasty (1009–1225) of Vietnam, chose the site of Hanoi for Hanoi—then called Thang Long (“Rising Dragon”)—for his capital. It Thang Long remained the main capital of Vietnam until 1802, when the last Vietnamese dynasty, the Nguyen (1802–1945), transferred the capital south to Hue. The name city occasionally was renamed for periods of time, and one of these names, Dong Kinh, given to the city it during the Later Le dynasty (1428–1787), became corrupted by Europeans to Tonquin; during . During the French - colonial period (1883–1945) the name Tonkin was used to refer to the entire region. In 1831 the city of Dong Kinh was renamed Ha Noi (“City Between “Between Two Rivers”) by the Nguyen dynasty.

Under French rule, Hanoi again became an important administrative centre. In 1902 it was made the capital of French Indochina. This was due in large part to largely because of Tonkin’s proximity to southern China, where the French sought to expand their influence, and also to because of Tonkin’s mineral resources. Hanoi remained the administrative centre during the Japanese occupation (1940–45) of the territory.

In August 1945, following the Japanese surrender, the Viet Minh under the leadership of Ho Chi Minh seized power in Hanoi, and the city was established as the capital of the Democratic Republic of Vietnam. The French, however, reasserted their control over Hanoi from 1946 until their defeat at Dien Bien Phu on May 7, 1954. Shortly thereafter Hanoi became the capital of the Democratic Republic of Vietnam (North Vietnam).

During the Vietnam War, the bombing of Hanoi by the United States in 1965, 1968, and 1972 caused massive damage. Following the collapse of South Vietnam on April 30, 1975, North Vietnam extended its control over all of Vietnam. On July 2, 1976, the Socialist Republic of Vietnam was proclaimed, and Hanoi was established as its capital. The city observed its 1,000th anniversary in early October 2010 by staging a number of events that culminated with a massive parade on October 10.

Many of Hanoi’s centuries-old monuments and palaces have been destroyed by foreign aggression and civil war, but there remain several historical and scenic points. Among the latter is Lake Hoan Kiem (“Lake of the Restored Sword”). Historical sites include the Co Loa citadel, dating from the 3rd century BCBCE; the Temple of Literature (1070), dedicated to Confucius; the Mot Cot (“One-Pillar”) Pagoda (1049); and the Temple of the Trung Sisters (1142). The University of Hanoi, the Revolutionary Museum, the Army Museum, and the National Museum are important cultural institutions.

Since 1954 Hanoi has been transformed from a primarily commercial city into an industrial and agricultural centre. Manufactures include machine tools, electric generators and motors, plywood, textiles, chemicals, and matches. Rice, fruits and vegetables, cereals, and industrial crops are grown in the surrounding area.

Hanoi is also a communications centre. Roads link Hanoi with other major Vietnamese cities, and railway lines provide access to its port of Haiphong; to K’un-ming Kunming in Yunnan province, China; and to Ho Chi Minh City (Saigon). Small ocean-going oceangoing vessels can sail to Hanoi on the Red River, and many small rivers are navigable from the capital to most parts of northern Vietnam. Hanoi has two airports. Pop. (2004 est.2009) 12,420644,400536.