In 631, [Tang Emperor] Taizong decided to resume the Sui policy of attacking the warlike state of Koguryŏ by sending an expedition to gather the bones of Chinese troops who had perished during earlier campaigns. Tang soldiers also pillaged Koguryŏ villages, throwing that kingdom into an uproar. The presence of massive Chinese armies on Koguryŏ soil also profoundly affected the political outlook in Paekche, Silla, and Yamato. When the Tang assaulted Koguryŏ again in 641, the elites in Paekche, Koguryo,Yamato, and Silla panicked. Between 641 and 647, militaristic, centralizing coups rocked each kingdom, as conspirators hoped to assemble the resources and troops necessary to fend off the coming Tang invasion.
In Japan, what is known as the Taika Reform took place in 645, concentrating leadership in the hands of a coterie of disenchanted royals (Princes Naka and Karu) and nobles (Nakatomi, later Fujiwara, no Kamatari). After killing off the Soga before the eyes of a startled monarch during a banquet, the rebels announced their intentions to take control of all the land and human resources of the islands, using institutions modeled after successful Chinese precedents. In other words, the best way to repel the Chinese was to copy their advanced political system and use it against them. Members of the cabal moved immediately to secure all weapons and arsenals, especially in the Kanto, home to the majority of mounted fighters. For the next fifteen years, the leaders of the Taika palace revolution struggled to play local leaders off against each other so as to concentrate power in their own hands.
The conflict in Korea, however, kept forcing its attention on the Taika leaders. After all, Paekche was a Yamato ally and a source of invaluable materials, ideas, and immigrants. Between 621 and 650, Yamato’s long-time enemy, Silla, sent envoys to the Tang court, and eventually the two cemented an alliance. Tang wanted the accord because its direct assaults on Koguryŏ were proving no more effective than those of the Sui, and the court needed an ally located at Koguryŏ’s rear. Finally, Tang and Silla decided that the best way to destroy Koguryŏ was to first conquer Paekche, a feat accomplished in 660 with an army of more than one hundred thousand. Most of the Paekche royal house fell into the hands of the alliance, but some escaped to Japan.
Beginning in 661, the Yamato court sent flotillas of small vessels to join Paekche guerillas fighting to revive their fortunes. By 663, more than twenty-five thousand Yamato troops were on erstwhile Paekche soil. At this time, a Yamato embassy was visiting the Tang court, but Taizong decreed that he had “determined … to take administrative measures in regard to the lands east of the sea, and you, visitors from Wa, may not return.” The envoys were locked in prison for months to prevent them from giving away Taizong’s plans. Later that year, the Tang navy and Silla army crushed the Yamato troops and Paekche partisans at the Battle of the Paekch’on River. It was one of the most decisive engagements in Japanese history.
Prince Naka and his supporters were now faced with a true emergency. Naka ascended the throne as the monarch Tenji and ordered beacons and Korean-style mountain fortifications erected from northern Kyushu, up the Inland Sea, to the Kinai. He withdrew his court to Otsu, guarded by mountains and safer from the looming threat. Meanwhile, the Tang-Silla alliance advanced from victory to victory, smashing Koguryŏ in 668. It is amazing that, although Tenji’s centralizing policies had met resistance from the beginning and he was now branded as a loser for the defeat in Korea, he managed to reform the bureaucracy and attempted to implement a census in 670.
When Tenji died in 671, he was unpopular with most local notables because they had lost men in Korea. He pressed his son Prince Otomo to succeed him, but Tenji’s brother, Prince Oama, secluded in the Yoshino Mountains to the south, had other ideas. In a brief civil war, Oama routed his nephew and took the title of Tenmu, “the Heavenly Warrior Emperor” (tenno). Born in 631, Tenmu had witnessed the Taika coup as a boy and the Battle of the Paekch’on River as a youth. He knew that to resist an invasion he had to have a strong, stable government capable of calling on the material and human resources of the entire archipelago. If Tenmu needed any further persuasion, Silla, which had implemented modified Chinese institutions, unified the peninsula, and then terminated its alliance with the Tang and chased the Chinese armies out of Korea. Fear of invasion consumed the Japanese court for several decades, and relations with Silla (668-935) were hostile for most of the 700s.