Lê Thánh Tông (1442–1497) was emperor of Vietnam from 1460 until his death. He is generally regarded as one of the greatest emperors of Vietnamese history and the Vietnamese "Hammurabi."[citation needed]

Lê Thánh Tông, born Lê Tư Thành, was the son of Emperor Lê Thái Tông and his mother was Ngo Thi Ngoc Dao. He was a half brother of Lê Nhân Tông and it is likely that his mother and Nguyễn Thị Anh (the mother of Lê Nhân Tông) were related (cousins or perhaps sisters). He was educated just like his half brother, the emperor, at the palace in Hanoi. When his elder half brother, Nghi Dân, staged a coup and killed the emperor in 1459, Prince Tư Thành was spared. Nine months later, when the second counter-coup was successfully carried out, the plotters asked Prince Tư Thành to become the new emperor and he accepted.

The leaders of the counter-coup which removed (and killed) Nghi Dân were two of the last surviving friends and aides of Lê Lợi: Nguyễn Xí and Đinh Liệt. These two old men had been out of power since the 1440s but they still commanded respect due to their association with the heroic Lê Lợi. The new king appointed these men to the highest positions in his new government, Nguyễn Xí as Emperor's Councilor and Đinh Liệt as commander of the army of Vietnam.

Thánh Tông was strongly influenced by his Confucian teachers and he resolved to make Vietnam more like the Song Dynasty with its Neo-Confucianist philosophy and the key idea that the government should be run by men of noble character as opposed to men from noble families. This meant that he needed to take power away from the ruling families (mostly from Thanh Hóa province) and give power to the scholars who did well on the official examinations. The first step on this path was to restart the examination process, which had continued only fitfully in the 1450s. The first great examination was held in 1463 and, as expected, the top scholars were men from the delta (around the capital), not the men from Thanh Hóa province.

Thánh Tông encouraged the spread of Confucian values throughout Vietnam by having "Temples of Literature" built in all the provinces. Here, Confucius was venerated and the classic works on Confucianism could be found. He also halted the building of any new Buddhist or Taoist temples and ordered that monks were not to be allowed to purchase any new land.

Following the Chinese model, Lê Thánh Tông instituted six ministries for running the government: Finance, Rites, Justice, Personnel, Army, and Public Works. Nine grades of rank were set up for both the civil administration and the military. A Board of Censors was set up with royal authority to monitor governmental officials and the power to report directly to the emperor. However, governmental authority did not extend all the way to the village level. The villages were ruled by their own councils in Vietnam (Vietnam, Trials and Tribulations of a Nation D. R. SarDesai, ppg 35-37, 1988).

With the death of Nguyễn Xí in 1465, the noble families from Thanh Hóa province lost their leader and they were mostly relegated to secondary positions in the new Confucian government of Thánh Tông. However, they still retained control over Vietnam's armies, the old general, Đinh Liệt, was still in command of army.

In 1469, all of Vietnam was mapped and a full census was taken, listing all the villages in the kingdom. Around this time the country was divided into 13 dao (provinces), ruled by three top officials: Administrator, General, and Judge. Thánh Tông also ordered that a new census should be taken every six years. Other public works that were undertaken included building and repair of granaries, using the army to rebuild and repair irrigation systems after floods, and sending out doctors to areas afflicted by outbreaks of disease. Also in 1469, a title for Thánh Tông's reign was chosen, Great Virtue (Hong-duc). The king was just 25 years old and already the country was better off than ever before.

The new government proved to be just and effective and represents a successful adaptation of the Chinese Confucian system of government outside of China.

Map of Vietnam showing the conquest of the south (the Nam tiến) Light green area conquered by Lê Thánh Tông.

In 1465, Vietnam was attacked by pirates from the north. This was dealt with by sending additional forces to the north to fight the pirates. Thánh Tông also sent a military force to the west to subdue the Ai-lao mountain tribe that was causing troubles.

In 1470, the Vietnamese began preparing for a crucial war against the Champa kingdom to the south. The war actually started with an attack by the Cham king, Tra-Toan, who led a Champa army into the border area of Vietnam. Lê Thánh Tông responded with his typical energy and efficiency, a large army was mobilized from all over the country and a delegation was sent to the Ming court laying out the reasons for Vietnam's counterattack. On 6 November 1470, he ordered barbarian-fighting generals Đinh Liệt and Lê Niem to command the vanguard of 100,000 men and move south. On 16 November 1470, Lê Thánh Tông personally led the main army of 150,000 troops and marched south. On 18 December, the first troops entered Champa territory.[1]:117

On 5 February, Champa king Tra-Toan ordered his brother Thi Nai to lead six generals and 5,000 troops and elephants to secretly approach Lê Thánh Tông's army. The Vietnamese forces discovered this plan so a 30,000 men strong army commanded by generals Le Hy Cat, Hoang Nhan Thiem, Le The, and Trịnh Van Sai attacked the enemy's rear from the sea. At the same time, an army commanded by Nguyen Duc Trung ambushed the Champa army and forced it to withdraw and. This army was then completely wiped out by Le Hy Cat's troops.

On 27 February, Lê Thánh Tông personally led the troops to capture Thi Nai, the most important harbor of Champa.

On 29 February, the Vietnamese army surrounded the Champa capital city of Vijaya (near modern-day Qui Nhơn). The city was captured, and the Cham king, Tra-Toan, was taken captive. He died on the return journey to Thang Long. Cham losses were immense, some 60,000 dead and 30,000 enslaved. The Champa regions of Amaravati and Vijaya were formally annexed to the Vietnamese kingdom as the newly organized province of Quang-nam.[1]:118

The Dai Viet Imperial army continued marching south until it reached Cả pass - some 50 miles north of the Champa city of Kauthara (modern-day Nha Trang).

The conquest of the Cham kingdoms started a rapid period of expansion by the Vietnamese southwards into this newly conquered land. The government used a system of land settlement called đồn điền (屯田).

Under this system, military colonies were established in which soldiers and landless peasants cleared a new area, began rice production on the new land, established a village, and served as a militia to defend it. After three years, the village was incorporated into the Vietnamese administrative system, a communal village meeting house (dinh) was built, and the workers were given an opportunity to share in the communal lands given by the state to each village. The remainder of the land belonged to the state. As each area was cleared and a village established, the soldiers of the don dien would move on to clear more land. U.S. Library of Congress Country Studies - Vietnam

In 1479, in response to continued attacks from the west, Lê Thánh Tông waged war against the federation of Lān Xāng (modern day Laos). A powerful Vietnamese army invaded the Lao lands, sacking the capital city of Luang Phrabāng (Vietnam, Trials and Tribulations of a Nation D. R. SarDesai, pg 35, 1988). Dai Viet would intervene at least once more in Laos during the rule of Trịnh Căn in 1694. As well, the modern-day provinces of Lai Châu and Điện Biên were annexed by Vietnam from Lan Xang, and are currently part of Vietnam.

Lê Thánh Tông was aggressive in his relations with foreign countries including China and Malacca and cracked down on foreign trade and contacts, enforcing an isolationist policy. A large amount of trade between Guangdong and Vietnam happened during his reign. Early accounts recorded that the Vietnamese captured Chinese whose ships had blown off course and detained them. Young Chinese men were selected by the Vietnamese for castration to become eunuch slaves to the Vietnamese. It has been speculated by modern historians that the Chinese who were captured and castrated by the Vietnamese were involved in trade between China and Vietnam instead of actually being blown off course by the wind and they were punished as part of a crackdown on illegal foreign trade by Vietnam.[2][3][4][5][6][7][8][9] Records show that the Vietnamese performed castration in a painful procedure by removing the entire genitalia with both penis and testicles being cut off with a sharp knife or metal blade. The procedure was agonizing since the entire penis was cut off.[10][11][12][13][14][15][16] The young man's thighs and abdomen would be tied and others would pin him down on a table. The genitals would be sterilized with pepper water and then cut off. A tube would be then inserted into the urethra to allow urination during healing. Any facial hair such as the beard would fall off and the eunuch's voice would become like a girl's.[17] The eunuchs served as slaves to the Vietnamese palace women in the harem like the consorts, concubines, maids, Queen, and Princesses, doing most of the work.[18][19][20][21][22][23] The only man allowed in the Palace was the Emperor, the only others allowed were his women and the eunuchs since they were not able to have sexual relations with the women. The eunuchs were assigned to do work for the palace women like massaging and applying make up to the women and preparing them for sex with the Emperor.[24][25][26][27]

Several Malay envoys from the Malacca sultanate were attacked and captured in 1469 by Annam (Vietnam) as they were returning to Malacca from China. The Vietnamese enslaved and castrated the young from among the captured.[28][29][30][31][32]

A 1472 entry in the Ming Shilu reported that when some Chinese from Nanhai county escaped back to China after their ship had been blown off course into Vietnam, where they had been forced to serve as soldiers in Vietnam's military. The escapees also reported that they found out up to 100 Chinese men remained captives in Vietnam after they were caught and castrated by the Vietnamese after their ships were blown off course into Vietnam. The Chinese Ministry of Revenue responded by ordering Chinese civilians and soldiers to stop going abroad to foreign countries.[33][34][35][36] China's relations with Vietnam during this period were marked by the punishment of prisoners by castration.[37][38]

A 1499 entry in the Ming Shilu recorded that thirteen Chinese men from Wenchang including a young man named Wu Rui were captured by the Vietnamese after their ship was blown off course while traveling from Hainan to Guangdong's Qin subprefecture (Qinzhou), after which they ended up near the coast of Vietnam, during the Chenghua Emperor's rule (1447 - 1487) . Twelve of them were enslaved to work as agricultural laborers, while the youngest, Wu Rui (吳瑞) was selected for castration since he was the only young man and he became a eunuch attendant at the Vietnamese imperial palace in Thang Long. After years of service, he was promoted at the death of the Vietnamese ruler in 1497 to a military position in northern Vietnam. A soldier told him of an escape route back to China and Wu Rui escaped to Longzhou. The local chief planned to sell him back to the Vietnamese, but Wu was rescued by the Pingxiang magistrate and then was sent to Beijing to work as a eunuch in the palace.[39][40][41][42][43]

Lê Thánh Tông created and widely distributed a new legal code - also called Hong-duc. The new laws were

"based on Chinese law but included distinctly Vietnamese features, such as recognition of the higher position of women in Vietnamese society than in Chinese society. Under the new code, parental consent was not required for marriage, and daughters were granted equal inheritance rights with sons. U.S. Library of Congress Country Studies - Vietnam

A group of 28 poets was formally recognized by the court (the Tao Dan) and a new official history of Vietnam was written called The Full History of Đại Việt (Đại Việt Sử ký Toàn thư). The historian Ngô Sĩ Liên compiled this in 1479[50] and it was published under supervision of the emperor.

As a young prince he was given the best Confucian education, his teacher was Tran Phong who later wrote about how serious a student Thanh Tong had been. He cared deeply about implementing Confucian principals in his government and seeing that the land was in harmony through the following of rituals.

Thanh Tong toured the entire country in the year 1467, addressing local problems that he found, firing government officials, and re-distributing land that had been illegally taken. This made him very popular with the people.

He also wrote poetry, some of which has survived. He wrote the following at the start of his campaign against the Champa:

One hundred thousand officers and men,
Start out on a distant journey.
Falling on the sails, the rain

Softens the sounds of the army.

Lê Thánh Tông tried to be and essentially succeeded in becoming the ideal Confucian ruler: deeply concerned with good government and personal morality.

The first part of this history is based on the doctoral thesis of John K. Whitmore "The Development of the Le Government in Fifteenth Century Vietnam" (Cornell University, 1968). The thesis is mostly concerned with the structure and make-up of the Le government from 1427 to 1471.

The second part is based in part on the Library of Congress Country studies for Vietnam