Military of the Ryukyu Kingdom

The military of the Ryukyu Kingdom defended the kingdom from 1429 until 1879. It had roots in the late army of Chūzan, which became the Ryukyu Kingdom under the leadership of King Shō Hashi. The Ryukyuan military operated throughout the Ryukyu Islands, the East China Sea, and elsewhere that Ryukyuan ships went. Ryukyu primarily fought with other Ryukyuan kingdoms and chiefdoms, but also Japanese samurai from Satsuma Domain and pirates. Soldiers were stationed aboard ships and Ryukyuan fortifications. The Ryukyuan military declined after the 17th century.

Early history
Chūzan Seikan, the first official history of Ryukyu, details the military victories of Shō Hashi. He first captured Ōzato Castle in 1403, then overthrew King Bunei of Chūzan in 1407, installing his father as king. He moved the capital from Urasoe to Shuri. During the early 1410s, aji, Ryukyuan feudal lords, under the rule of Hokuzan got into a dispute with their king, Hananchi. On 11 March 1422, Shō Hashi gathered the forces of the ajis of Urasoe, Goeku, and Yomitanzan at Shuri. He convinced the ajis of Nago, Kunigami, and Haneji to join him, then he marched his forces to Nago. At Nago, Shō Hashi's force of 500 attacked a castle, defeating its 200 defenders. Upon reaching Nakijin Castle, Shō Hashi sent 20 infiltrators to set fires and open the castle gates. Hananchi committed suicide, and Shō Hashi had conquered Hokuzan. Shō Hashi allowed Gosamaru, Yomitanzan Aji, to build Zakimi Castle for supporting him in the war. According to Chūzan Seifu, a succession dispute broke out when the king of Nanzan, Taromai, died in 1429, prompting Shō Hashi to march south and conquer the kingdom, finally unifying Okinawa Island as the Ryukyu Kingdom.

Expansion and rebellions
There are indications that Ryukyu invaded the Amami Islands during the 1440s, but in 1450 sailors from Korea were shipwrecked on Gaja Island, where they found the island half occupied by Ryukyu and half occupied by Satsuma Domain of Southern Japan. Gaja Island is about 105 mi north of Naze, the principal settlement on Amami Ōshima, and 120 mi south of Kagoshima City, the capital of Satsuma.

After a violent succession dispute in 1453, Shō Taikyū became king. Amawari, who had overthrown the Katsuren Aji, worried the king with his wealth and military strength. The king asked Gosamaru to build Nakagusuku Castle in a location between the royal palace at Shuri Castle and Katsuren Castle. After the castle was built, Gosamaru started to mobilize his forces. Amawari told the king that Gosamaru was plotting a rebellion, to which the king ordered an attack on Nakagusuku Castle. Gosamaru committed suicide and his castle fell; the king then ordered Uni-Ufugusuku to lead an army against Katsuren Castle, where Amawari was defeated and executed. Uni-Ufugusuku was awarded Goeku Magiri (modern Okinawa City) and built Chibana Castle.

In 1466, King Shō Toku launched an invasion of Kikai Island in the Amami Islands with 2,000 soldiers and 50 ships. Satsuma launched an invasion of Amami Ōshima in 1493, but Ryukyu defeated Satsuma. Rebellions in Amami Ōshima were put down in 1537, 1538, and 1571. Additionally, there were pirate attacks on Naha in 1553, 1556, and 1606 where the port was successfully defended.

During the reign of Shō Shin (r. 1477–1537), the military was completely reorganized. This included the development of the hiki (引) system, which had been the basic military unit since Shō Hashi. Shō Shin turned them into a quick reaction force with military, police, and administrative duties. He confiscated weapons from the peasantry, then forced the aji to relocate to his capital to minimize the chances of rebellion and to centralize the military under total royal control. After 1522, the ajis' armies, called "aji gun" (按司軍), became known as "magiri gun" (間切軍). Also in 1522, Shō Shin had the Pearl Road (真珠道) constructed between Naha and Shuri to allow quicker troop movement between the port and the royal palace, which was then extended by his son, Shō Sei, to connect Tomigusuku, Mie, and Yarazamori Castle in 1546.

Invasion of Ryukyu
In April 1609, Satsuma Domain launched a second invasion of the Ryukyu Kingdom. Within a month, they conquered the Amami Islands in the face of fierce resistance on all but Okinoerabu Island. After Satsuma landed on Kouri Island, across from Unten Harbor, Ryukyu sent a thousand soldiers, commanded by Nago Ryōhō, to reinforce Nakijin Castle. On 30 April, Nago Ryōhō's force met the Satsuma army near Nakijin, but retreated after sustaining a 50% casualty rate; Nakijin was captured and razed and Shō Kokushi, the garrison commander and the heir to the Ryukyuan throne, died from wounds sustained in the battle. Satsuma landed in Yomitanzan unopposed on 3 May, advancing overland towards Shuri and by sea towards Naha. Ryukyu was able to stop and drive Satsuma away from Naha, but Satsuma was able to capture Urasoe Castle and cross the Taihei Bridge, surrounding Shuri Castle. After fierce resistance, Shuri fell on 6 May and King Shō Nei surrendered.

After the disastrous war, Ryukyu was forced to cede the Amami Islands and become a vassal of Satsuma. Jana Ueekata, who had commanded the defense of Naha, was executed for refusing to sign the peace treaty. While the hiki system was reduced in status during the 17th century, Ryukyu's military remained to defend the country and its tribute ships from pirates in the East China Sea. For example, hundreds of Ryukyuan soldiers were mobilized in 1640 when foreign ships were spotted near the Yaeyama Islands, and there is documentation of Ryukyuans defeating pirates as late as the turn of the 19th century.

Annexation by Japan
In 1871, a tribute ship was shipwrecked on Taiwan, and the crew was slaughtered by Taiwanese aborigines in the Mudan Incident. The following year, the Meiji government informed the royal government that the kingdom was then a domain of Japan (as Ryukyu Domain). In 1874, Japan invaded Taiwan on behalf of the Ryukyuans. After the royal government resisted and disobeyed the Meiji government, 400 Japanese soldiers landed at Naha in March of 1879 with a demand that King Shō Tai abdicate. After a few days the Japanese occupied Shuri Castle, and the deposed king was taken to Tokyo. Ryukyu Domain was abolished and Okinawa Prefecture was established.

Organization
The Ryukyuan military hierarchy was a top-down chain of command, with the king at the top. Below the king was the Sanshikan, a government body of his three most trusted advisors. There were three "Watches" (番), each of which composed of four hiki, that guarded the Shuri-Naha area. Historian Gregory Smits concludes that the Sanshikan originated from the commanders of the three Watches. In addition to the Watches, each magiri had forces of an unknown size, as well as the 17 or so Ryukyuan castles that were manned and Ryukyuan ships that were defended by an onboard hiki. The hiki themselves were further broken down by rank: the hiki was commanded by a Sedo (Okinawan: Shiidu); below the Sedo was the rank of Chikunodono, followed by Satonushibe, and at the bottom was Keraiakukabe.

Weapons
The Ryukyuan military used a combination of imported weapons from China and Japan, often modified, and some domestically made weapons. The most common Chinese imports were guns and cannons, especially multi-barreled guns known as hand cannons. Japanese swords, especially the wakizashi, were highly sought after, and were usually modified to allow for better one-handed use to wield a shield. Both Chinese-style and Japanese-style halberds were also widely used.

Ryukyu also made use of junks at sea. Ryukyuan ships were defended by soldiers and armed with cannons; fleets of nearly 100 junks were used during some of Ryukyu's military campaigns. Ryukyuan ships continued to officially operate until 1875.

Martial arts
The origins of karate (Okinawan: tii), kobudō, and tegumi are often attributed either to Ryukyu's military or nobility. Common myths state that karate developed because of confiscations of or bans on weapons by King Shō Shin and Satsuma Domain, respectively. However, Uni-Ufugusuku (d. 1469) was known for his skills in tii.