King Setthathirath established it as the capital of Lan Xang in 1560. When Lan Xang fell apart in 1707 it became an independent kingdom. In 1779, it was conquered by the Siamese general Phraya Chakri and made a vassal of Siam.
When King Anouvong raised an unsuccessful rebellion, it was obliterated by Siamese armies in 1827. It eventually passed to French rule in 1893. It became the capital of the French protectorate of Laos in 1899.