The history of Myanmar (also known as Burma; မြန်မာ့သမိုင်း) covers the period from the time of first-known human settlements 13,000 years ago to the present day. The earliest inhabitants of recorded history were a Tibeto-Burman-speaking people who established the Pyu city-states ranged as far south as Pyay and adopted Theravada Buddhism.
Another group, the Bamar people, entered the upper Irrawaddy valley in the early 9th century. They went on to establish the Pagan Kingdom (1044–1297), the first-ever unification of the Irrawaddy valley and its periphery. The Burmese language and Burma culture slowly came to replace Pyu norms during this period. After the First Mongol invasion of Burma in 1287, several small kingdoms, of which the Kingdom of Ava, the Hanthawaddy Kingdom, the Kingdom of Mrauk U and the Shan States were principal powers, came to dominate the landscape, replete with ever-shifting alliances and constant wars.
In the second half of the 16th century, the Toungoo dynasty (1510–1752) reunified the country, and founded the largest empire in the history of Southeast Asia for a brief period. Later Taungoo kings instituted several key administrative and economic reforms that gave rise to a smaller, more peaceful and prosperous kingdom in the 17th and early 18th centuries. In the second half of the 18th century, the Konbaung dynasty (1752–1885) restored the kingdom, and continued the Taungoo reforms that increased central rule in peripheral regions and produced one of the most literate states in Asia. The dynasty also went to war with all its neighbours. The Anglo-Burmese wars (1824–85) eventually led to British colonial rule.
British rule brought several enduring social, economic, cultural and administrative changes that completely transformed the once-agrarian society. British rule highlighted out-group differences among the country's myriad ethnic groups. Since independence in 1948, the country has been in one of the longest running civil wars involving insurgent groups representing political and ethnic minority groups and successive central governments.