From 600 to 659, Japan sent seven emissaries to Tang China. But for the next 32 years, during a period when Japan was formulating its laws based on Chinese texts, none were sent. Though Japan cut off diplomatic relations with China, Japan sent 11 emissaries to Silla, and Silla is also recorded in Nihon Shoki as sending embassies to Japan 17 times during the reigns of Emperor Tenmu and Empress Jitō. The ruling classes of Yamato and Baekje were on amicable terms, and Yamato deployed its navy to aid Baekje, in 660–663, against an invasion by Silla and Tang China (see battle of Baekgang).