From 632 to 654 AD, two queens inherited the Silla throne in their own right, indicating a significant difference between ancient Silla practices and the male-dominated hierarchy of China. Silla's 27th ruler, Queen Son-dok, (reined 632-647 AD) quickly established good relations with T'ang China, and introduced many Chinese customs, such as fashions in court dress. She also sponsored and supported the Hwarang-do and sent many Hwarang warriors on expeditions into China to learn Chinese war tactics. Her nephew, who later became King Mu-yol , the 29th ruler (reigned 654-661 AD), and his son, King Mun-mu, the 30th ruler (reigned 661-681 AD) led Silla in its efforts to unify the Korean peninsula.
As a part of its unity efforts, Silla sought the aid of the T'ang Dynasty in China. The Silla envoy to the T'ang court, Kim Chunch Ue, attained an alliance with the Chinese military to fight against Koguryo and Paekche. The agreement said that, if the united forces defeated Koguryo, the land south of P'yongyang would belong to Silla and China would get all land to its north, and, if they defeated Paekche, the entire country would belong to Silla.
The T'ang attacked Paekche from the sea, and Silla forces, led by General Kim Yu-sin (a Hwarang), attacked from the land. In 660 AD, the alliance defeated Paekche. However, the T'ang government ignored its agreement, established five military bases in Paekche, and attempted to establish pro-Chinese enclaves inside Silla. Although this angered Silla, since it was still battling Koguryo, it did not have the resources to resist the T'ang.