Hue was originally the capital of southern Vietnam. The Nguyen Dynasty ruled the city. In 1805 Emperor Gia Long, a member of the Nguyen family, united the country. Hue became the capital of Vietnam. It was so until 1945, when the communist government established the capital in Hanoi.