Battle of Baekgang
The Battle of Baekgang was Japan's greatest defeat in its premodern history. Japan's losses were enormous. Japan also lost a key ally on the East Asian continent in Baekje as well as a direct link to continental technology and culture. Due to the scale and severity of their defeat, the Yamato court feared an invasion from either or both Tang or Silla. In response, they built a huge network of shore fortifications throughout the rest of the 600s. In 664, the Yamato court established frontier guards and signal fires in Tsushima Island, Iki Island, and northern Kyushu. Also, embankments storing water were built around the fortresses in Kyushu, which were collectively called the Water Fortress. In 665, the Yamato court sent Baekje generals and artisans to construct a rampart in Nagato province, and two ramparts in Kyūshū. In 667, a rampart was constructed in the Yamato region, another one at Sanuki, and yet another at Tsushima island. Unaware of the outbreak of the Silla-Tang War (670-676), the Japanese would continue to build fortifications until 701, after finding out that Silla was no longer friendly with Tang.