The first recorded use of espionage in Japan dates back to the 6th century, yet the figure known as the ninja did not emerge as a distinct class until the 15th century. Before the word shinobi became synonymous with stealth, the concept existed in the shadows of early Japanese history, where Prince Shotoku employed a spy named Otomono Sahito around the year 574. These early agents were not the black-clad assassins of modern imagination but rather individuals who operated in a world where espionage was considered unsavory. The 10th-century Shōmonki records the death of a boy spy named Hasetsukabe no Koharumaru, who was killed for spying against the insurgent Taira no Masakado, highlighting that the stigma of secret service was present even in the early medieval period. The true lineage of the ninja began to take shape in 1162, when Daisuke Togakure, a defeated samurai, abandoned his traditional bushido code to travel to the mountains of southwest Honshu. There, he met Kain Doshi, a Chinese warrior-monk, and together they formulated ninjutsu, a counter-culture art of war that prioritized guerrilla tactics over honorable combat. This partnership laid the foundation for the first ninja school, the Togakureryu, which would eventually evolve into the professional mercenary groups of the Sengoku period.
The Mountain Guilds
The true power of the ninja lay not in individual heroism but in the formation of the Iga and Kōga clans, jizamurai families who carved out de facto independence in the remote mountains of Iga Province and the adjacent Kōka District. By the 1460s, these families had established their own leagues, known as ikki, which functioned as self-defense organizations that sold their services as mercenaries and spies to the highest bidder. The geography of Iga, with its secluded mountains and inaccessibility, provided the perfect sanctuary for the development of these secretive skills. The Iga professionals were specifically sought after for their expertise in siege warfare, or shirotori, which included night attacks and ambushes. While the Kōka ikki persisted until 1574, the Iga ikki held out until 1581, when Oda Nobunaga invaded and wiped out the organized clans. The survivors fled to the mountains of Kii or found refuge with Tokugawa Ieyasu, where they were well treated. Hattori Hanzō, a former Iga clan member, would later serve as Tokugawa's bodyguards, bridging the gap between the outlawed mountain clans and the new shogunate. The alliance between Iga and Kōka was formalized in a constitutional document around 1560, creating a powerful confederation that could challenge the might of the great daimyōs.The Tokugawa Transition
Following the conquest of the ninja clans, the role of the shinobi shifted from battlefield saboteurs to the silent guardians of the Tokugawa shogunate. In 1600, during the Siege of Hataya, a ninja snuck through Eastern Army defenders to plant the flag of the besieging army high on the front gate, a feat that demonstrated their continued utility even as the nature of warfare changed. The domain of Tsu, established in 1608 under daimyo Tōdō Takatora, employed Iga-ryū ninjas alongside local Musokunin, a class of part-time samurai who worked as farmers during peace and took up arms in war. By 1614, these Iga province warriors saw action during the siege of Osaka, where they served as auxiliaries in the winter phase. The Kōga ninja were later recruited by shōgun Tokugawa Iemitsu to fight against Christian rebels during the Shimabara Rebellion, which marked the final detailed record of ninja employed in open warfare. The rebellion ended in 1638 with the fall of Hara Castle, and the written accounts of the Kōga's reconnaissance actions became the last mention of ninja in war. After this, the ninja had to adapt to a new reality, serving as bodyguards, spies, and fire patrol officers for various domains, or changing their professions entirely to become doctors, merchants, or martial artists.