Ueda Castle: The Fortress That Repelled the Tokugawa Army Twice

In the turbulent age of the Warring States period, when warlords vied for supremacy, a genius strategist, Sanada Masayuki, who rose from the rank of an ashigaru commander to warlord, built the formidable Ueda Castle, renowned for repelling the overwhelming armies of Tokugawa not once, but twice. Masayuki was described by the unifier of the realm, Toyotomi Hideyoshi, as hyōri hikyo no mono (a tough warrior and strategist). Indeed, true to that reputation, Masayuki maneuvered with masterful subtlety among the powerful lords and safeguarded the Sanada domain against all odds. Thus, Masayuki laid the foundation upon which the Sanada family endured, their lineage lasting into the Meiji Restoration. Ueda Castle remains a silent testament to that legacy, whispering Masayuki’s brightest moments.

Ueda Castle_上田城
Ueda Castle @ Ueda City

A Right-hand Man of Lord Takeda

Sanada Masayuki_真田昌幸
Sanada Masayuki
@ Ueda City Museum

Sanada Masayuki (1547–1611, 真田昌幸) was born in Sanada village, near Ueda in Shinano Province. His father, Sanada Yukitsuna, was one of the famous Twenty-Four Generals of Takeda. Masayuki’s talent was recognized early by Takeda Shingen (1521-1573, 武田信玄), who appointed him as one of the Six Oku Kinju Attendants, the closest retainer of Shingen.

Masayuki saw his first battle in the Fourth Battle of Kawanakajima, the fierce struggle between Shingen and his great rival, Uesugi Kenshin (1530-1578, 上杉謙信) of Echigo. Later, as a commander of foot soldiers, he led 15 mounted warriors and 30 ashigaru (infantrymen) in many campaigns. At the Battle of Mimasetoge against the Hōjō, he achieved the honor of the first spear charge. He also joined Shingen’s westward campaign into Tokugawa territory, and at the Battle of Mikatagahara, he witnessed firsthand the legendary strength of Shingen’s tactics.

After Shingen’s death, Masayuki served his son Katsuyori, fighting at the decisive Battle of Nagashino and Shitaragahara. Through these battles, Masayuki became an active participant in the turning points of the Sengoku period. Yet, when the Takeda clan finally fell, he was cast into the storm of rival warlords fighting for supremacy. From this point, Masayuki began to use his brilliant strategy to secure the survival of the Sanada family.

The Fall of the Takeda Clan

Map of powerful clans in Sengoku Period_領国地図
Territory Map of Powerful Clans

After the crushing defeat at the Battle of Nagashino and Shitaragahara, Katsuyori lost many of the veteran retainers who had served since Shingen’s time. Seeking to recover his strength, he allied with the Uesugi clan, who were part of the anti-Nobunaga coalition. But this move put him into direct conflict with the Hōjō clan, the Uesugi’s rivals.

Katsuyori ordered Masayuki to attack Numata Castle, a Hōjō stronghold, and Masayuki succeeded in capturing it. However, in 1582, Tokugawa Ieyasu (1543-1616, 徳川家康) launched a fierce offensive, leading to the fall of Takatenjin Castle. This defeat caused many local lords under the Takeda to abandon Katsuyori. The most decisive betrayal occurred when Kiso Yoshimasa, lord of the Kiso Valley in Shinano and brother-in-law to Katsuyori, defected to Oda Nobunaga (1534-1582, 織田信長). With this, Oda Nobunaga, Tokugawa Ieyasu, and Hōjō Ujinao (1562-1591, 北条氏直) all invaded Takeda territory. As the Takeda homeland of Kai faced imminent collapse, Masayuki advised his lord, Katsuyori, to retreat to the mountain fortress of Iwabitsu Castle. Masayuki pleaded with his lord:

“Now that the Takeda homeland of Kai is in grave danger, I beg you to take refuge in my stronghold, Iwabitsu Castle in Agatsuma, Kouzuke Province. I shall stand by your side. With three to five thousand men, we can hold out for three or even five years.”

Then, he himself went ahead to prepare the castle for Katsuyori’s arrival. However, Katsuyori ignored Masayuki’s suggestion. Following the advice of his hereditary retainers, he chose instead to retreat to Iwadono Castle in Kai Province. This decision sealed his fate. In March 1582, as Oda forces pressed into Kai, Katsuyori was cornered and forced to take his own life at Tenmokuzan. With his death, the Takeda clan came to an end.

Shifting Allegiances for Survival

After the fall of the Takeda clan, Masayuki, having lost his lord, changed allegiance with remarkable flexibility to survive. His shifting loyalties can be traced as follows. (Some of the months below are approximate.)

  • March 1582 — Oda Nobunaga (following the fall of the Takeda)
  • June 1582 — Uesugi Kagekatsu (after Nobunaga died in the Honnō-ji Incident)
  • July 1582 — Hōjō Ujinao (with the Hōjō advance into northern Shinano)
  • September 1582 — Tokugawa Ieyasu (amid hostility between the Hōjō and Tokugawa)
  • July 1585 — again Uesugi Kagekatsu (after the Hōjō–Tokugawa alliance)
  • October 1585 — Toyotomi Hideyoshi (once Uesugi submitted to Hideyoshi)
  • September 1600 — The Battle of Sekigahara

The Hōjō clan immediately advanced north to invade Oda territories, the former Takeda territories, forcing Nobunaga's retainer, Takigawa Kazumasu, to retreat to his own domain in Ise. Local lords in Shinano and Kouzuke soon submitted to the Hōjō. Meanwhile, the Hōjō’s longtime rivals, the Uesugi, also pushed south into northern Shinano, seizing the four districts of Kawanakajima and even advancing to Kaizu Castle. As a result, the Sanada lands of Agatsuma found themselves faced with Uesugi to the north. After much deliberation, Masayuki first pledged allegiance to the Uesugi. This was because no reinforcements could be expected from the Uesugi, while the Hōjō forces were advancing northward in their invasion. Yet only a month later, in July, he switched his loyalty to the Hōjō. His decision was driven by necessity: the Uesugi, preoccupied with their conflict against Kiso Yoshimasa in the Kiso Valley, could not provide the reinforcements Masayuki desperately needed.

Between Tokugawa and Hōjō

The situation continued to change with great speed. Ieyasu advanced into Suwa and Kai, the former territories of Takeda. In response, the Hōjō altered their plans and also marched to Kai, deepening the conflict between the two powers. In September, Masayuki broke with the Hōjō and pledged allegiance to the Tokugawa. In return, Ieyasu promised to guarantee Masayuki’s territories.

Yet events soon took an unexpected turn. In October, at the request of Oda Nobukatsu, Nobunaga’s second son, Ieyasu made peace with the Hōjō and allied with them. The treaty contained a condition that Masayuki could never accept:

Ueno Province was to be recognized as Hōjō territory, and Masayuki was required to hand over Agatsuma and Numata to them.

Masayuki firmly refused to surrender these lands. Thus, despite being buffeted by the overwhelming powers surrounding him, he continued to rely on his ingenuity and tactical flexibility. The year 1582—so turbulent, so decisive—came to a close with Masayuki still standing, though the struggle for survival was far from over.

The First Battle of Ueda Castle

In 1583, Masayuki began constructing Ueda Castle with Tokugawa support. The fortress stood on the frontline against the Uesugi, who were enemies of both the Tokugawa and the Hōjō. The following year, 1584, the dispute over Agatsuma and Numata was temporarily set aside, as both Tokugawa and Hōjō were occupied elsewhere. Ieyasu was busy supporting Oda Nobukatsu in the Battles of Komaki and Nagakute, as well as the siege of Kanie Castle, against Toyotomi Hideyoshi (1537-1598, 豊臣秀吉). Meanwhile, Ujinao was engaged in campaigns in southern Kouzuke, targeting the Yura and Nagao clans.

Once these conflicts were settled, however, Ujinao pressed Ieyasu to enforce the transfer of Agatsuma and Numata. He personally marched into southern Kouzuke, demanding that Masayuki surrender the two territories. Masayuki once again refused. Instead, in defiance of both Tokugawa and Hōjō, he pledged allegiance to the Uesugi. A written oath issued by Uesugi Kagekatsu explicitly guaranteed Masayuki’s right to hold Agatsuma and Numata.

Sanada Masayuki armor_真田昌幸甲冑
Sanada Masayuki’s Armor
@ Ueda City Museum

In August 1585, Ieyasu, enraged by Masayuki’s defiance, marched with a massive force of more than 7,000 men to attack Ueda Castle. Masayuki, with fewer than 2,000 troops, prepared to meet the challenge with great strategy. At the same time, he sent his second son, Nobushige (better known as Yukimura), as a hostage to Uesugi Kagekatsu in exchange for military support. Masayuki placed his eldest son, Nobuyuki, at Toishi Castle to guard the northern flank. In front of Ueda Castle’s main gate, he set up the chidorigake fences in a staggered pattern to obstruct enemy movement. The Sanada forces fought with calculated precision: striking, retreating, then luring the Tokugawa troops deeper inside. When Tokugawa troops pushed into the castle grounds, Sanada soldiers unleashed concentrated fire from towers and behind stone walls, causing them to fall into chaos. As they attempted to retreat, they became entangled in the chidorigake fences. At that moment, Masayuki ordered a full counterattack. From Toishi Castle, Nobuyuki struck the Tokugawa from the flank, while local villagers, summoned by the sound of conch shells, joined in with fierce cries. The Tokugawa soldiers panicked by believing the Uesugi reinforcements had arrived. Terrified, they fled toward the Kamikawa River. But the river was swollen with floodwaters, and many drowned. Others were cut down in pursuit. The remaining Tokugawa army regrouped and attacked Maruko Castle, another Sanada stronghold. Yet when Uesugi forces arrived, they were forced to withdraw.

Thus, the First Battle of Ueda Castle ended in a brilliant victory for the Sanada. Masayuki achieved this victory through Masayuki’s extraordinary strategy.

Masayuki under Toyotomi Hideyoshi

Although Masayuki had repelled the Tokugawa and driven back the Hōjō, he knew that relying solely on the Uesugi was not enough to stand against such powerful neighboring warlords. By this time, Uesugi Kagekatsu himself had already submitted to Toyotomi Hideyoshi, who was rising rapidly as the unifier of the realm. Seeking stronger protection, Masayuki traveled to Kyoto in June 1586 to pledge his allegiance directly to Hideyoshi. Around the same time, Masayuki’s son, Nobushige, had been sent as a hostage to the Uesugi but was transferred to Hideyoshi.

In October of that same year (1586), the situation changed dramatically when Ieyasu submitted to Hideyoshi. One of the conditions of Ieyasu’s submission was that Sanada Masayuki would once again serve as a Tokugawa retainer. This created a dangerous dilemma. Masayuki had broken away from Ieyasu to ally with the Uesugi and then with Hideyoshi, yet now he risked being forced back under Tokugawa control. If that happened, Agatsuma and Numata might well be handed over to the Hōjō. Unable to find a way out, Masayuki delayed responding to Hideyoshi’s repeated summons to Kyoto. Frustrated by his hesitation, Hideyoshi eventually ordered Ieyasu to punish Masayuki. At this desperate moment, Masayuki received help from Kagekatsu, who petitioned Hideyoshi to resolve the Numata dispute instead of resorting to force. After much back-and-forth, the order for Masayuki’s destruction was withdrawn. Hideyoshi imposed a settlement:

The Hōjō would receive two-thirds of the Numata province, including Numata Castle, while the Sanada would retain the remaining one-third. Furthermore, Ieyasu was instructed to grant the Sanada equivalent land to compensate for what they had lost.

Following this judgment, Masayuki withdrew from Numata, and the territory was formally handed over to the Hōjō. Trouble soon arose again. The Inomata clan, newly installed by the Hōjō as lords of Numata Castle, seized Nagurumi Castle, which was one of the holdings that had been reserved for the Sanada. This violation caused Hideyoshi to be furious. Declaring that the Hōjō had trampled upon “the judgment of the authority,” he issued an ultimatum. Even Ieyasu’s mediation could not save the Hōjō. In 1590, Hideyoshi launched a massive campaign against them. Masayuki joined the largest army of the Toyotomi forces, Tōsandō-army, and marched toward Odawara Castle, the Hōjō's stronghold. After a long siege, the castle surrendered, marking the end of the Hōjō clan.

In the aftermath, Masayuki was confirmed in possession of his ancestral Ueda domain. His eldest son, Nobuyuki, was granted authority to govern Numata. With this settlement, Masayuki’s position as a retainer of the Toyotomi was firmly established, and he continued to play an active role on the stage of the warring era.

The Second Battle of Ueda Castle

Sekigahara Battlefield between Tokugawa and Toyotaomi clans_関ヶ原合戦場
The Battle of Sekigaraha

After Hideyoshi died in 1598, tensions grew between Ieyasu and Hideyoshi's chief retainer, Ishida Mitsunari. The rivalry soon escalated into the great Battle of Sekigahara in 1600. At this decisive moment, Sanada Masayuki made a fateful decision. He and his second son, Nobushige (Yukimura), sided with the Western Army led by Mitsunari. Meanwhile, his eldest son, Nobuyuki, pledged loyalty to Tokugawa’s Eastern Army. This way, no matter the outcome, the Sanada family would have a chance to survive.

As Tokugawa Hidetada, Ieyasu’s son, advanced along the Nakasendō Road with 38,000 troops toward Sekigahara, Masayuki prepared to resist him at Ueda Castle with barely 3,000 men. Hidetada was only 22 years old, while Masayuki was an experienced commander of 54. When Hidetada demanded surrender, Masayuki appeared to comply, promising to open the gates. But this was a ruse to buy time and prepare his defenses. Realizing the stratagem, Hidetada angrily ordered a full attack. Once again, Masayuki’s brilliant tactics came into play: luring the Tokugawa soldiers deep into the castle grounds, then unleashing withering gunfire from towers and walls. For eight days, the Sanada forces harassed and made Hidetada's army stuck, forcing them into retreat. Delayed by this setback, Hidetada’s army arrived too late to participate in the decisive Sekigahara battle.

Masayuki’s Death and the Fate of the Sanada

The Battle of Sekigahara ended in just a single day, with Tokugawa’s victory. Masayuki and Yukimura were spared execution, instead being confined at Mount Koya, later moving to Kudoyama at its base. Masayuki never regained freedom and died there in 1611 at the age of 65.

Three years later, in 1614, Ieyasu raised arms against Hideyori, son of Hideyoshi, in the Siege of Osaka. Nobushige escaped from Kudoyama to join the Toyotomi force. In and around Osaka Castle, he fought well like his father. In the summer campaign of 1615, he led a daring charge against Ieyasu’s main camp, nearly toppling his banner. But, at last, outnumbered and exhausted, Nobushige fell in battle, but he was remembered ever after as a legendary warrior. Meanwhile, Nobuyuki, who had sided with the Tokugawa, was confirmed in his holdings. He ruled over both Numata and Ueda, serving as lord of Ueda Castle for 23 years before being transferred to Matsushiro, where he governed as Tokugawa's lord for 35 years, firmly establishing the Sanada under the Tokugawa regime.

Ueda Castle, once the symbol of Masayuki’s genius—where Tokugawa armies had been twice repelled—was dismantled by the Tokugawa after the Sanada’s departure. Yet the stone walls that remain along the Amagafuchi moat, together with the reconstructed towers, still bear silent witness to the legacy of Masayuki. In spring, cherry blossoms adorn the grounds, in autumn, rows of zelkova trees glow with color, and, at night, the castle takes on a dreamlike beauty. Walking in and around Ueda Castle, one cannot help but reflect on the brilliant mind of Sanada Masayuki and his significant mark.

Sanada Masayuki Timeline

1547Sanada Masayuki was bornAge =1
1553Sanada Masayuki went to Takeda Shingen as a hostage7
1561Sanada Masayuki joins the 4th Battle of Kawanakajima15
1566Sanada Nobuyuki was born20
1567Sanada Nobushige was born21
1575Sanada Masayuki succeeded the Sanada family head29
1580Sanada Masayuki captured Numata Castle34
1580Hojo Ujinao succeded to the position of Hojo clan (5th Lord)34
1582Takeda can ended36
1582Sanada Masayuki served under Oda Nobunaga36
1582Sanada Masayuki served under Uesugi Kagekatsu36
1582Nobunaga was killed at Honnoji by Akechi Mitsuhide36
1582Sanada Masayuki served under Hōjō clan and then Tokugawa Ieyasu36
1584Ieyasu made a victory at Komaki-Nagakute battle against Toyotomi Hideyoshi38
1584Sanada Masayuki served under Uesugi Kagekatsu38
1585The 1st Battle of Ueda Castle39
1585Sanada Masayuki served under Uesugi Kagekatsu39
1585Sanada Masayuki served under Toyotomi Hideyoshi39
1590Sanada Masayuki joins the Siege of Odawara Castle44
1600The 2nd Battle of Ueda Castle54
1600The Battle of Sekigahara began at 8:00. The Eastern Army won around noon.54
1600Sanada Masayuki and Nobushige were exiled to Kōyasan and Kudoyama54
1603Ieyasu established the Tokugawa Shogunate at Edo57
1611Sanada Masayuki died65
1614The Winter Siege of Osaka-
1615The Summer Siege of Osaka -
1622Sanada Nobuyuki was transferred to Matsushiro-
1658Sanada Nobuyuki died-

Recommendations to Visit

Ueda Castle Park

Access: 12-minute walk from JR Ueda Station