Meanwhile, in the north, Trinh Tac and his literati advisors embarked on the most ambitious effort to reform government since the time of Le Tu Thanh, two centuries before. King Le Duy Ky died in late 1662. Trinh Tac selected one of Le Duy Ky’s sons, 10-year-old Le Duy Vu, to sit upon the throne. The years of Le Duy Vu’s reign, known as the Canh Tri reign period (1663–1671), became, after Le Tu Thanh’s Hong Duc era, the most celebrated time of good government in the historiography of Vietnamese Confucianists. The same kinds of laws, edicts, rules, and regulations about examinations, appointments, promotions, demo- tions, administrative and judicial procedures, corruption, abuse, public morality, population registers, taxation, conscription, etc. were promulgated during the Canh Tri period as had been routine during the reign of Le Tu Thanh. The difference was that the Canh Tri period lacked a king like Le Tu Thanh and lasted only one-quarter as long as that king’s reign. Instead of a king there was a hard-bitten though somewhat enlightened warlord, Trinh Tac, and a gathering of aspiring administrators shepherded by a group of old scholar-officials led by Pham Cong Tru. There was no firm hand holding the system in place by force of personality. Consequently, the bureaucratic procedures formulated at this time simply became an arena for factional conflict over control of policy. The warriors of Thanh Hoa and Nghe An were not to be so easily pushed aside by the “poor but erudite” scholars of the Red River plain. The test of wills was not simply between military and civil officials but rather among civil officials with different backgrounds and experiences. On one side were those who had been closely involved with the armies during the Nghe An campaign, most, but not all of them, from Nghe An and Thanh Hoa. These favored continuation of the war in the south. On the other side were those who had spent the war in villages mobilizing men and rice for the southern battle- fields, most, but not all of them, from the Red River plain. These were ready to end the conflict with the south. The question of continuing the war was not necessarily the most important issue, but it came to stand for two conflicting views of how the country should be governed. The event that ignited the matter was the appointment of Pham Cong Tru’s son, Pham Cong Kiem, to a high provincial post in 1665. Some considered him to be unqualified for the position, and, when his father retired three years later and was no longer able to protect him, he was dismissed for incompetence. It is not clear whether he was in fact incompetent or if he was a victim of intrigue. In seeking his dismissal in 1665, high officials of the military faction were hoping to unravel the position of his father and those associated with him. Trinh Tac could not allow this to happen, nor yet could he afford to give too much offense to the men representing the view of his soldiers. Trinh Tac sought to finesse the matter by charging those who had called for Pham Cong Kiem’s dismissal with relatively minor violations of bureaucratic protocol and demoting them out of the top echelon of the court hierarchy. During the following year, administrative disci- pline was tightened and bureaucratic litigation was regulated as Trinh Tac sought to keep both groups engaged in his government. Regional examinations had become a scandal and already in 1664 new rules had been issued to stop rampant cheating. In the regional examinations of 1666, particular attention was given to candidates from Mo Trach, the home district of the Vu family that was closely allied with Trinh Tac and which had been famously successful in previous examinations. There had been so many recent graduates from Mo Trach that accusations of chicanery were rife. Nevertheless, despite all manner of precaution, men from this district were disproportionately successful in 1666. This could mean that this district enjoyed excellent educational opportunities or it could mean that being connected to the Trinh family trumped the most thorough efforts to prevent corruption. It was natural that the struggle for control of policy spread to the examination system, which afforded access to government positions. The effect of this was to immobilize the capital examination of 1667, in which only three men graduated. By this time, those demoted in 1665 were being promoted again as prospects for a military solution to the Cao Bang problem materialized. In early 1667, diplomatic contact was established with the new Qing dynasty in China. Since the Mac had been protected in Cao Bang by their status as a Ming vassal, Trinh Tac wagered that the Qing would acquiesce to their demise. In autumn of 1667 a large Trinh army conquered Cao Bang, sending the last of the Mac leaders, Mac Kinh Vu, fleeing to the Qing. However, to Trinh dismay, the Qing decided that any Ming vassal also belonged to them, and in 1669 the Trinh were ordered to restore Cao Bang to Mac Kinh Vu. Not until 1677, when Mac Kinh Vu joined the rebellion of Wu Sangui in Yunnan against the Qing were the Trinh allowed to occupy Cao Bang, thus finally bringing an end to the long political career of the Mac family, though as late as 1715 Trinh officials in Cao Bang still found it necessary to hunt down a man causing unrest by claiming to be a descendent of the Mac, and in 1719 special instructions were issued to ensure security in that sensitive border province. The successful expedition to Cao Bang in 1667 did much to raise the prospects of those arguing for a new invasion of the south. Pham Cong Tru retired in 1668, and officials close to the military regained high positions. Three years of drought delayed preparations, but in 1671 soldiers from the Red River plain were being mobilized and trained. In 1672 the Trinh armies moved south. Trinh Tac, Trinh Can, and the new king, 12-year-old Le Duy Hoi, all accom- panied the expedition. The southern army that waited at the walls was under the command of Nguyen Phuc Tan’s 20-year-old fourth son, Prince Hiep, a brilliant, monkish youth who had already earned the respect of military commanders two and three times his age. Nguyen Huu Tien had died in 1666, murmuring his chagrin at not living to see the downfall of the Trinh. Nguyen Huu Dat was 69 years old and placed in command of a new, strategically sited fortification called Sa Phu, “sand port,” on the dunes overlooking the southern bank of the Nhat Le River mouth. According to southern historians, there was a pre-battle parley between the armies in which the old arguments were recited about which side was more loyal to the Le dynasty, the southern view being that the Trinh were keeping the Le kings as prisoners while the northerners accused the Nguyen of being in rebel- lion. By now this was a very tiresome argument, and it was the last time for it to be heard. The Wall of Tran Ninh, erected ten years before in front of the pre-existing network of walls, became the focus of battle. The Trinh were breaking through this wall and were on the verge of overrunning it when Prince Hiep ordered Nguyen Huu Dat to move his men across the river to reinforce it. Nguyen Huu Dat went forward at night, his men bearing torches and planks to repair the walls before an expected dawn attack. Prince Hiep moved up to Sa Phu and from there directed a water battle denying the northern fleet entrance into the river. Mean- while, Nguyen Huu Dat stopped the northern advance at the Wall of Tran Ninh. The Trinh were forced to withdraw. It was the last battle in this Fifty Years War. After victory celebrations, Prince Hiep, refusing any contact with women, entered a temple to devote himself to the Buddha. He liked to go out and preach about the Buddha to the common people. In 1675, at the age of 23, he died, a shooting star of a hero. Trinh Tac was determined to have done with this fruitless war. In 1673, he recalled Pham Cong Tru out of retirement and began to systematically demote or remove those who disagreed with him. When the capital examination of that year graduated only five men amidst factional conflict, he ordered a special exam to be held in which thirty men were selected. By early 1674 he had outman- euvered his opponents in the arena of bureaucratic appointments, and they resorted to the only asset they had left, the soldiers from Thanh Hoa and Nghe An who were stationed in the capital as the palace guard. In the summer of 1674, incited by officials from those provinces who had many years of service but had been recently dismissed, the guardsmen mutinied. They demolished Pham Cong Tru’s house, killed Nguyen Quoc Trinh, one of Trinh Tac’s most trusted advisors, and demanded the release of Trinh Toan, Trinh Tac’s younger brother, who had been popular among the soldiers and had lived in confinement since the death of his father in 1657. Trinh Tac responded to this challenge with characteristic alacrity and guile. Trinh Toan was given poison. Cash was distributed to the guardsmen. Their ringleaders were discreetly seized and executed. The officials who had stirred up the episode were reinstated for a few months until matters settled down and then they were dismissed for the last time. Most significantly, Trinh Tac officially conferred the dignity of leadership upon Trinh Can, taking himself out of the limelight. The edict proclaiming the elevation of Trinh Can praised his military achievements but, unlike every such kind of edict in the past, did not mention the necessity of pacifying the south to complete the restoration of the Le dynasty. The war policy was finally abandoned. When he died in 1675 at the age of 76, Pham Cong Tru had the satisfaction of having contributed to a major reform of government. When Trinh Tac died in 1682, he had the satisfaction of having engineered the first peaceful succession of power from one generation to the next in his family since the beginning of its fortunes more than a century before. His own prolonged accession had been marked by a battle with two of his brothers in 1645, by conspiracies in 1649 and 1652, and by his pre-emptive arrest of Trinh Toan when Trinh Trang finally died in 1657. The Canh Tri era produced one piece of legislation that had a long-term effect on village politics and agrarian affairs, particularly in the Red River plain. In the Hong Duc era, Le Tu Thanh had instituted a sexennial registration of land ownership as the basis for taxation on fields. The periodic revision was intended to take account of changes in land ownership, but it was a labor-intensive and often litigious procedure that required relatively large numbers of officials and clerks with sufficient authority to conduct the necessary investigations and to assemble the required paperwork. It was a product of Le Tu Thanh’s unusual interest in administration and his charismatic hands-on approach to government. This system apparently continued in some form through the years of Mac rule. It was able to function as long as the power of the central state had the ability to reach into the villages and to compel the cooperation of village leaders. The disorders accompanying the Le restoration led to the breakdown of the sexennial registration system. During the decades of Trinh military occupation of the Red River plain, agrarian taxes were collected in a relatively unsystematic, ad hoc manner. Military authorities often ignored tax laws with arbitrary confisca- tions, and different officials sometimes competed to obtain revenue from the same source. The disaffection of the rural population combined with an absence of rational government to create a gap between village authorities and the state. Trinh Tac and his entourage of literati endeavored to revive rural administration, including the sexennial registration system. But, the administrative capacity of the state was unequal to the task. Provincial and district officials lacked the manpower and expertise to penetrate the details of village property arrange- ments, while village leaders had learned how to dissemble in their relations with higher authorities. Canh Tri was not Hong Duc, and Canh Tri legislation on agrarian taxation displays the superficiality of Canh Tri achievements in comparison with those of Hong Duc. In 1664, in what became known as the “equal rule” (binh le), or Stabilization Act, a survey of land and registration of ownership was initiated throughout the country. It was completed five years later and became the basis for taxation from that time on. There would be no revisions. Changes in land ownership thereafter would not be taken into account. In practice, what this meant was that local leaders became responsible for the collective assessment of their village. Instead of going into the villages to collect taxes from individual taxpayers, district magistrates now stood at the village gate and received what was due from the hands of village leaders. This measure reflects the relative weakening of central administration in comparison with the times of Le Tu Thanh and the Mac. It also reflects the relative strengthening of the autonomy of village leaders and of their authority within the villages. The well-known aphorism that “the law of the king stops at the village gate” dates from this time and reflects the Canh Tri compromise between villages and tax collectors enacted by the Stabilization Act. The long-term impracticality of this measure became glaringly apparent half a century later and subsequent efforts to remedy its shortcomings led to decades of unrest and uprisings in the eighteenth century. A famous proclamation of the Canh Tri era is the 47-article “Edict to Explain Civilizing Instructions” issued in 1663, commonly interpreted as a major initia- tive to enforce Confucian moral behavior. It systematically presents a list of exhortations and prohibitions that had been regularly issued in more piecemeal form since the fifteenth century and would continue to be issued into the nineteenth century. Updated versions would appear in the late twentieth century. This edict, and all the others like it, encouraged thought about public morality and gave authorities a legal basis for their efforts to keep people involved in productive work rather than letting them waste time on gambling, cockfighting, playing chess, pornography, singing, dancing, lewd festivals, worshipping evil spirits, sitting around in temples, or following strange religions. Nevertheless, such edicts never put an end to these things. Perhaps more successful were the rules for following a Confucian model of family life with ancestral veneration, marriage rites, mourning regulations, and a hierarchy of deference, which provided a blueprint for aspiring patriarchs and families ambitious to gain favor with the rulers. Against the efforts of Confucian officials to promulgate their values should be set the prospering of spirit cults, the building and repair of Buddhist temples, and the spread of Christianity, all of which were salient features of Vietnamese society in the seventeenth century. The most important work of the Canh Tri people, so far as surviving know- ledge about the Vietnamese past is concerned, was in writing history. Pham Cong Tru supervised a continuation of the fifteenth-century work of Ngo Si Lien through the reign of Le Duy Ky in 1662, just before the beginning of the Canh Tri era. Thirty years later, Le Hy (1646–1702), who began his career by passing the capital examination of 1664 as a teenager, supervised the addition of thirteen additional years to 1675, covering Canh Tri (1663–1671) and the short reign of Le Duy Hoi that followed (1672–1675), which in effect carried the account through to Pham Cong Tru’s death and included the victory of Trinh Tac over the war party and the formal transfer of power to Trinh Can. This work was printed with woodblocks in 1697, and is known today as the Chinh Hoa Edition of the Complete Book of the History of Great Viet. The writing of official histories was traditionally defined by the rise and fall of dynasties. For Pham Cong Tru and Le Hy and their colleagues, however, the dynastic idea was no longer of historical importance. For them, it was as if they lived in a time when educated men had found solid footing after many years of war and turmoil and were able to celebrate the ascendancy of their pacific approach to government over the vainglorious aims and violent means of warriors. Nguyen Phuc Tan and Trinh Tac were the architects of two countries that would subsequently go their separate ways for another century. Their predeces- sors had remained entangled in each other’s ambitions, unable to entirely let go of one another. But these two men understood that there was enough for them to do without trying to rule the other’s country too. Trinh Tac had to do something about the disconnection of his regime from the majority of its population and the habits of intrigue that made leadership in his family so precarious. Victory in the south would simply feed the power and ambition of the most undisciplined elements of his regime, producing endless problems. Ending hostilities with the south enabled him to concentrate on the more urgent priority of building a government administration that would no longer fear popular disaffection. The north was turning inward. Nguyen Huu Dat, whose whole life had been dedicated to fighting the Trinh, died in 1681 at the age of 78. His spirit was still alive a few months later, shortly before Trinh Tac’s death, when rumors reached the south that the Trinh had gone off to fight rebels and had left Dong Kinh unprotected. Voices were raised at Nguyen Phuc Tan’s court proposing that it was an excellent time to attack the north. Against this exuberant prospect, Nguyen Phuc Tan decided that not enough men and supplies were available for such an adventure. It was the last recorded discussion of such an idea at Nguyen Phuc Tan’s court. Sometime during the Nghe An campaign, perhaps in 1658, the year of the expedition to Cambodia, Nguyen Phuc Tan lost interest in conquering the north. He began to look south. Effort was more likely to yield benefit on the relatively open Mekong frontier than on the densely populated and fiercely defended plains in the north. When Nguyen Phuc Tan died in 1687, the situation he had helped to create by encouraging warfare among Khmer princes was moving rapidly toward a major geo-political shift on the Vietnamese southern frontier. The south was turning outward.