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 was annexed and Okinawa Prefecture was established.