Hanoi is the capital of Vietnam and the country's second largest city. Its population in 2009 was estimated at 2.6 million for urban districts, 6.5 million for the metropolitan jurisdiction. From 1010 until 1802, it was the most important political centre of Vietnam. It was eclipsed by Huế during the Nguyen dynasty as the capital of Vietnam, but Hanoi served as the capital of French Indochina from 1902 to 1954. From 1954 to 1976, it was the capital of North Vietnam. The city is located on the right bank of the Red River. Hanoi is located at 1,760 km (1,090 mi) north of Ho Chi Minh City.October 2010 officially marked 1000 years since the establishment of the city.
Hanoi has been inhabited since at least 3000 BC. One of the first known permanent settlements is the Co Loa citadel (Cổ Loa) founded around 200 BC.
Hanoi has had many names throughout history, all of them of Sino-Vietnamese origin. During the Chinese domination of Vietnam, it was known first as Long Biên, then Tống Bình and Long Đỗ. In 866, it was turned into a citadel and named Đại La.
In 1010, Ly Thai To, the first ruler of the Lý Dynasty, moved the capital of Đại Việt to the site of the Đại La Citadel. Claiming to have seen a dragon ascending the Red River, he renamed the site Thăng Long "Rising Dragon") - a name still used poetically to this day. Thăng Long remained the capital of Đại Việt until 1397, when it was moved to Thanh Hóa, then known as Tây Đô , the "Western Capital". Thăng Long then became Đông Đô, the "Eastern Capital."
In 1408, the Chinese Ming Dynasty attacked and occupied Vietnam, changing Đông Đô's name to "Eastern Gateway", Đông Quan in Vietnamese. In 1428, the Vietnamese overthrew the Chinese under the leadership of Lê Lợi, who later founded the Lê Dynasty and renamed Đông Quan Đông Kinh ("Eastern Capital") or Tonkin. Right after the end of the Tây Sơn Dynasty, it was named Bắc Thành ("Northern Citadel").
In 1802, when the Nguyễn Dynasty was established and moved the capital to Huế, the old name Thăng Long was modified to become Thăng Long ("Ascending & Flourishing"). In 1831, the Nguyễn emperor Minh Mạng renamed it Hà Nội ("Between Rivers" or "River Interior"). Hanoi was occupied by the French in 1873 and passed to them ten years later. As Hanoï, it became the capital of French Indochina after 1887.
The city was occupied by the Japanese in 1940 and liberated in 1945, when it briefly became the seat of the Viet Minh government after Ho Chi Minh proclaimed the independence of Vietnam. However, the French returned and reoccupied the city in 1946. After nine years of fighting between the French and Viet Minh forces, Hanoi became the capital of an independent North Vietnam in 1954.
During the Vietnam War, Hanoi's transportation facilities were disrupted by the bombing of bridges and railways. These were all, however, promptly repaired. Following the end of the war, Hanoi became the capital of a reunified Vietnam when North and South Vietnam were reunited on July 2, 1976.
On May 29, 2008, it was decided that Ha Tay Province, Vĩnh Phúc's Mê Linh district and 4 communes of Lương Sơn District, Hoa Binh be merged into the metropolitan area of Hanoi from August 1, 2008. Hanoi's total area then increased to 334,470 hectares in 29 subdivisions with the new population being 6,232,940., effectively tripling its size. The Hanoi Capital Region (Vùng Thủ đô Hà Nội), a metropolitan area covering Hanoi and 6 surrounding provinces under its administration, will have an area of 13,436 square kilometers with a population of 15 million by 2020.