While Japan was advancing centralization, shifting international conditions led to its first overseas military expedition.
Tang China, allied with Silla (southeastern Korean Peninsula), invaded Baekje (southwestern Korean Peninsula).
After its defeat, Baekje appealed to Japan, with which it had close ties.
But helping Baekje meant making enemies of Tang and Silla.
Tang was a major power with strong influence in East Asia, and defeat could have put not only Baekje but Japan itself at risk.
On the other hand, victory could have made Baekje a subordinate state of Japan.
Empress Saimei ultimately decided to aid Baekje and set out, personally leading troops from the capital, but she died just before the campaign.
Her son, Prince Naka no Oe, carried on her will and led the Japanese forces, and Japan’s first war with a foreign power, the Battle of Baekgang, began.
Japan sent reinforcements by sea, but suffered a crushing defeat as Tang-Silla strategy and natural conditions worked against them.
After Prince Naka no Oe became Emperor Tenji, he implemented defensive measures to protect Japan from a potential Tang invasion.
To secure manpower and funding, he compiled a nationwide census register known as the Kogo Nenjaku.
He built fortifications such as Mizuki along the Kyushu coast and stationed troops there.
He also moved the capital to Omi Otsu-no-miya, a naturally defensible area surrounded by Lake Biwa and mountains.
However, as Tang’s ambitions to control the Korean Peninsula became clear, relations with Silla deteriorated.
When war broke out between Tang and Silla, Japan was not invaded by Tang.