The hwarang code was established in the 3Oth year of King Chin-Hung's rule. Two noted hwarang warriors, Kwi-san and Chu-hang, sought out the famous warrior and Buddhist monk, Wong-gwang Popsa, in Kusil temple on Mount Unmun and asked that he give them lifetime commandments that men who could not embrace the secluded life of a Buddhist monk could follow. The commandments, based on Confucian and Buddhist principles, were divided into five rules (loyalty to the king and country, obedience to one's parents, sincerity, trust and brotherhood among friends, never retreat in battle, and selectivity and justice in the killing of living things), and nine virtues (humanity, justice, courtesy, wisdom, trust, goodness, virtue, loyalty, and courage).
These principles were not taken lightly, as in the case of Kwi-san and Chu-hang, who rescued their own commander, General Muun, when he was ambushed and had fallen from his horse during a battle in 603 AD. Attacking the enemy, these two hwarang were heard to cry out to their followers, "Now is the time to follow the commandment to not retreat in battle!" After giving one of their horses to the general, they killed a great number of the pursuing enemy and finally, "bleeding from a thousand wounds," they both died.
The code of the hwarang is similar to the more commonly known code of the Japanese samurai, bushido. The bushido code was established in feudal Japan during the 12th to 17th centuries to serve as a social guide rule of life and as a set of ideals for the samurai or military class. The code of the hwarang-Do played a similar role in the Korean kingdom of Silla approximately 1,000 years earlier. Being established during the 6th to 10th centuries, hwarang-do was considered more ancient and refined than bushido. The Silla Dynasty lasted 1,000 years, and the code of the hwarang, known as sesok-ogye, endured throughout the Silla and Koryo dynasties. Its influence led to a unified national spirit and ultimately the unification of the three kingdoms of Korea around 668 AD.
The practice of bushido appears to have perpetuated a feudal system in Japan for over 700 years with continual provincial wars, whereas Silla and Koryo thrived under the influence of the Hwarang. These Korean dynasties, based on Hwarang ethics, remained internally peaceful and prosperous for over 1,500 years while defending themselves against a multitude of foreign invasions. This can be compared to the Roman Empire, which thrived for only 1,000 years. Oyama Masutatsu, a well-known authority on Karate in Japan, has even suggested that the hwarang were the forerunners of the Japanese samurai.