alliance with Tang China. The fall of Baekje was met with an immediate response by the Yamato Court, which considered Baekje a close ally and related country due to their long history of alliance as well as their shared history of intermarriage between the ruling classes and monarchs of their respective nations. The loss of their key ally was so great that Empress Saimei said: "We learn that in ancient times there have been cases of troops being asked for and assistance requested: to render help in emergencies, and to restore that which has been interrupted, is a manifestation of ordinary principles of right. The Land of Baekje, in its extremity, has come to us and placed itself in our hands. Our resolution in this matter is unshakable. We will give separate orders to our generals to advance at the same time by a hundred routes." Former generals of Baekje, including Gwisil Boksin, asked Japan to return Prince Buyeo Pung and requested military aid. Japan responded by deploying tens of thousands of troops onto the Korean Peninsula and some estimates claimed that as many as a thousand Japanese ships were dispatched to support Baekje. In 663, Japan, supporting Baekje, was defeated by the allied forces of Silla and Tang China in the Korean Peninsula (the Battle of Baekgang), and the restoration of Baekje ended up in failure. After the fall of Baekje, Japan took in many Baekje Korean refugees who were mainly craftspeople, architects, and scholars who played a major role in the social development of Japan during that period. While at the same time hostility between Japan and Silla escalated. Empress Jitō honored King Zenko by giving him the hereditary title of Kudara no Konikishi and allowed him to pass on his royal lineage to future generations. According to the , Takano no Niigasa came from a background of the naturalized clansmen and was a 10th-generation descendant of King Muryeong of Baekje. She was chosen as a wife for Emperor Kōnin and subsequently became the mother of Emperor Kanmu. Japan has had official contact with the Chinese since the 7th to 8th centuries. Chinese culture was introduced to Japan via the Korean Peninsula, but the Korean value slumped when Chinese culture was introduced directly via Japanese missions to Tang China. Emperor Kanmu severed diplomatic relations with Silla in 799. From the early 9th–11th centuries, Japanese pirates plundered the southern