The dynasty officially began in 1428 with the coronation of Lê Lợi after he drove the Ming army from Vietnam. In 1527, the Mạc dynasty usurped the throne; when the Lê dynasty was restored in 1533, they still had to compete for power with the Mạc dynasty during the period known as Southern and Northern Dynasties. The restored Lê emperors held no real power, and by the time the Mạc dynasty was confined to only a small area in 1592 and finally eradicated in 1677, actual power was in the hands of the Nguyễn lords in the South and the Trịnh lords in the North, both ruling in the name of the Lê emperor while fighting each other. Their rule officially ended in 1788, when the peasant uprising of the Tây Sơn brothers defeated both the Trịnh and the Nguyễn, ironically in order to restore power to the Lê dynasty.
The Lê dynasty's rule saw Vietnam's territories grow from a small state in northern Vietnam at the time of Lê Lợi's coronation into almost its current size by the time the Tây Sơn brothers took over. It also saw massive changes to Vietnamese society: the previously Buddhist state became Confucian after 20 years of Ming rule. The Lê emperors instituted many changes modeled after the Chinese system, including the civil service and laws. Their long-lasting rule was attributed to the popularity of the early emperors. Lê Lợi's liberation of the country from 20 years of Ming rule and Lê Thánh Tông's bringing the country into a golden age was well-remembered by the people. Even when restored Lê emperors' rule was marked by civil strife and constant peasant uprisings, few dared to openly challenge their power, at least in name, for fear of losing popular support. When the Mạc dynasty tried to do so, they were not successful and were considered as usurpers and not recorded in official histories by later dynasties.
The founder of the Lê dynasty was the hero-Emperor of Vietnam, Lê Lợi (ruled 1428–1433). Lê Lợi was the son of a village leader in Thanh Hóa Province, the southern-most province of Vietnam at the time. When he was born, Vietnam was independent and under the rule of the Trần dynasty. However, the Trần Emperors had been weak for some decades and the powerful neighbor to the north, China was now unified and under the rule of the energetic founder of the Ming dynasty, the Hongwu Emperor. As was usual in Vietnamese history, a disputed succession was an excuse for the Chinese to re-assert control over Vietnam (See the Hồ dynasty for further details). The Chinese, now under the Yongle Emperor conquered and ruled Vietnam starting in 1407. They immediately tried to change it into another province of the Ming Empire. Many, if not all Vietnamese customs and laws were declared invalid. Distinctive features of Vietnamese life which had naturally emerged during the nearly 500 years of independence from China were suppressed. All resistance to this effort was treated as rebellion and was dealt with according to normal Imperial Chinese methods (villages were burned, people were tortured and executed).
Lê Lợi started a revolt against the Ming rulers in 1418. The revolt lasted for 10 years during which there was much bloodshed and many defeats. However, the Chinese were gradually beaten and finally Lê Lợi was victorious. He proclaimed himself the new Emperor of Vietnam, gave himself the name Lê Thái Tổ (the Founding Emperor), and was recognized as such by the new Xuande Emperor of China. However, after only five years on the throne, Lê Lợi became ill and died.
Lê Thái Tông (ruled 1433–1442) was the official heir to Lê Lợi, but he was only 11 years old. As a result, a close friend of Lê Lợi, Lê Sát, assumed the regency of the kingdom. Not long after he assumed the official title as Emperor of Vietnam in 1438, Lê Thái Tông accused Lê Sát of abuse of power and had him executed.