Pending the settlement of this Shimonoseki affair the Tokugawa military operations against Chōshū were delayed, and as the latter put to death three of the leaders of the disturbance in Kyōto, and made ample apologies for their offense, the force destined for the invasion of their fief was disbanded. There were, however, two parties in Chōshū; the one in favor of submitting to the shōgun so as to avert misfortunes otherwise apparently threatening the fief, and the other advocating determined resistance to the Tokugawa. At the head of the latter party was Takasugi Shinsaku, and he, having established relations with Sanjō and the other court nobles then refugees in Chōshū, succeeded in completely overcoming the pacific faction and obtaining ascendency in the fief. The Edo government now found itself openly defied by Chōshū, and a strong agitation arose in favor of inflicting summary punishment by sending another large expedition. Against this counsel dissenting voices were not unheard, but finally an expeditionary force was organized and moved southward, the shōgun himself accompanying it. A marked incident of this occasion was the refusal of the great Satsuma baron to send a quota of troops for service with the shōgun. His fief and Chōshū, whose mutual rivalry had at times amounted to bitter enmity, had concluded at last that in their union lay the only hope of accomplishing the purpose of unifying and consolidating the empire. Foremost among the far-seeing statesmen was Saigō Takamori of Satsuma, who never wavered in his conviction that no lasting amity could be established between the courts of Kyōto and Edo, and that the only solution of the national difficulties lay in the overthrow of the Tokugawa. To this view his fellow-clansmen subscribed, and relations were opened with Chōshū which finally led to the hearty coöperation of the two fiefs. En route for Chōshū the shōgun stopped at Ōsaka, where he was approached by the representatives of Great Britain, the Netherlands, and the United States, who insisted that Hyōgo should be opened for trade according to the provisions of the Edo treaties, and that the treaties should be ratified by the emperor. The shōgun, after reference to the sovereign, declined to entertain this demand, and the foreign representatives thereupon threatened to prefer it in person to the throne. The emperor, much incensed at the course events were taking, severely punished the chief officials of the shōgun who were directly responsible for the treaties, and this having been done without reference to the shōgun himself, placed the latter in such an embarrassing position that he laid his resignation at the foot of the throne and asked that Hitotsubashi Yoshinobu, of Mito, be appointed in his stead. He accompanied this document with a memorial praying for the imperial sanction to the treaties with foreign powers. The emperor declined to accept the shōgun's resignation, but gave his sanction to the treaties, the immediate opening of Hyōgo to foreign trade being, however, refused. Subsequent to these events the expedition against Chōshū was again put in motion, but the Chōshū men inflicted a crushing defeat upon it, inasmuch as this was the first occasion of a shōgun's taking the field in person since two hundred and fifty years before, the consequences were disastrous to the prestige of the Tokugawa, many of the feudal barons openly renouncing allegiance to them. While the campaign was still in progress the Shōgun Iyemochi died in the castle of Ōsaka, August, 1866, and was succeeded by Yoshinobu in December of the same year. The Emperor Kōmei also died shortly after. Owing to this sad event the expedition against Chōshū was finally abandoned. Thereafter the shōgun found himself confronted by such difficulties both at home and abroad that further tenure of office became impossible, and finally, acting on the advice of the lord of Tosa, resigned the office as the feudal overlord of Japan, and restored the administrative power into the hands of the sovereign. This memorable event occurred on October 14, 1867.
Feudalism, which had for nearly seven centuries controlled the administration of the empire, seemed now to have come to an end, but institutions so deeply rooted in the life of the nation and so long upheld by persons whose vital interests were interwoven therewith were not to die away without a struggle. It was mortifying to the supporters of the shōgun, who had so recently renounced his office from disinterested motives, to see his policy reversed, his old enemies raised to the highest posts of the new government, and he and his late councilors completely excluded from official life. The Chōshū baron and his son received the imperial pardon and reëntered Kyōto, while they as well as Sanjō Sanetomi were restored to their former ranks; the soldiers of Satsuma, Chōshū, Aki, Owari, and Echizen displaced the men of Aidzu and Kuwana as guards of Kyōto; and radical changes were made in official posts and emoluments, the offices of sōsai, gijō, and sanyo being newly established under the presidency of Prince Arisugawa. The first gijō were Princes Yoshiaki and Akira, together with Sanjō Sanetomi, Iwakura Tomomi, and the barons of Satsuma, Echizen, and Tosa. The sanyo were Ōhara Shigenori, Saigō Takamori, and Ōkubo Toshimichi. More than twenty court nobles were removed from office and the administrative power was assumed in effect by a government under the direct control of the sovereign.
On December 10 it was announced to the late shōgun, by order of the emperor through the medium of the barons of Owari and Echizen, that his administrative functions had been transferred to the emperor, and he was at the same time privately instructed to resign his post of lord keeper of the privy seal and to surrender the provinces hitherto forming his fief. The news of these instructions produced great excitement among the fudai barons, and the shōgun, apprehending that they might resort to violence on his behalf, petitioned the sovereign to allow him temporarily to retain the post of lord keeper of the seal as well as to hold the provinces of his fief, though he repeated his expression of resolve to divest himself of all administrative authority. This course did not, however, entirely allay the umbrage of the fudai barons, especially the lords of Aidzu and Kuwana. The shōgun himself, suspecting that the order stripping him of his dignities and possessions had been issued at the instigation of the chiefs of Satsuma and Chōshū, withdrew from the Nijō palace and shut himself up in the castle of Ōsaka. There, however, he was urgently counseled by the barons of Owari and Echizen to abandon all resistance to the throne and to present himself peacefully at the imperial court, and in obedience to this advice he was about to enter Kyōto guarded by a powerful escort, when intelligence reached him from Edo to the effect that a number of Satsuma rōnin, having assembled at the Satsuma mansion in the city, had fired on a barrack occupied by Tokugawa troops, and that the latter had consequently attacked the mansion and driven out its occupants, who had taken refuge in a warship anchored in Shinagawa Bay. Incensed by this news, the shōgun, on January 3 in the first year of the Meiji era, 1868, issued orders to the various clans to combine for the purpose of chastising Satsuma. He commenced the campaign by mustering the troops of Aidzu and Kuwana in Kyōto and marching to attack the forces of Satsuma and Chōshū. But in the engagements that ensued at Fushimi and Toba the shōgun's army was completely defeated, and Prince Yoshiaki was formally ordered by the imperial court to lead a punitory expedition against Tokugawa, now an open rebel. The latter retired to Edo by sea, accompanied by the forces of Aidzu and Kuwana, when they and twenty-seven other feudal chiefs were deprived by the emperor of all their ranks and offices, the duty of breaking their power by force of arms being intrusted to the barons of Aki, Chōshū, and Tosa. Also, special officers were dispatched to the various provinces to restore peace, and their presence impressed the feudal barons so strongly that no resistance was offered, and the provinces to the west of Kyōto and Ōsaka surrendered without hesitation to the imperial government. On February 9 Prince Arisugawa received the commission of commander in chief, with instructions to bring the east under control, and under his orders the imperial forces moved upon Tōkai, Tōsan, and Hokuriku. The prince entered Sumpu on March 5 and made preparations for the assault of Edo. Before the attack took place, however, the shōgun retired to a temple in Edo, and dispatched Ōkubo Tadahiro, Katsu Awa Yoshikuni, and others to open negotiations with Saigō Takamori, general of the imperial forces then about to move on the eastern capital. Both armies, the imperial and the feudal, were animated with an uncontrollable desire to fight to the last, and the imminent clash was barely averted by the word of honor exchanged between two individuals, General Saigō of the emperor's army and Katsu, a vassal of the shōgun. They had met each other only once, years before, but, although circumstances had placed them in hostile camps, had entertained so unbounded an admiration and confidence in each other's noble character that now only a few words sufficed for them to pledge, on their honor as samurai, to effect the surrender of the Tokugawa with their dignity unimpaired, and to save Edo from an unnecessary destruction of the lives and properties of its two million inhabitants. On March 4 the van of the imperial army entered Edo and occupied the castle, the Shōgun Yoshinobu being granted his life and confined in Mito. On the 15th the prince entered Edo, and in May a grant of lands yielding annually 700,000 koku of rice in Suruga, Tōtōmi, and Mutsu was made to the Tokugawa family for its maintenance.
When the imperial forces took possession of Edo castle, Enomoto Takeaki, a naval officer of the Tokugawa government, fled to the northern Island of Ezo, taking with him eight war vessels, and Ōtori Keisuke retired to Kazusa and Shimōsa. Further, a number of the Tokugawa vassals, calling themselves the shōgitai (loyal band), took refuge in Uyeno, northeast of Edo, and placing Prince Kozenbō, the lord abbot of Kwanyei-ji, at their head, refused to surrender to the imperial government. They were attacked by his majesty's forces and defeated after a sharp engagement, while Ōtori and his comrades, routed at Utsunomiya and Nikkō, fled to Aidzu, the feudal lord of which place had already returned thither, and in conjunction with the barons of Mutsu and Dewa had made preparations to uphold the Tokugawa cause by force of arms. But the imperial troops, advancing from Tōsan, Tōkai, and Hokuriku, brought into subjection the two clans of Sendai and Yonezawa, and entering Aidzu, took the Wakamatsu castle on September 22, thus completely breaking the resistance of the rebels and restoring tranquillity throughout the northern regions. In December Matsudaira Katamori, the Aidzu lord, was sentenced to perpetual confinement, and the fiefs of Sendai, Shōnai, and Morioka, which had made act of submission after the fall of Wakamatsu, were confiscated, and their lords confined. As for the Yonezawa fief, its territory was reduced and its lord ordered to surrender the management of affairs to his heir, while the fiefs of Mutsu and Dewa were divided into five and two provinces, respectively. Meanwhile, Enomoto and his followers, alleging the intention of reclaiming lands in Ezo, had occupied the fortress at Hakodate and obtained possession of a great part of the island. But they also finally in May, 1868, surrendered to the imperial forces. In August the name Ezo was changed to Hokkaidō, and it was divided into eleven provinces. The entire land of Japan thus passed under the sway of the imperial government. Although some of the feudal institutions still persisted, the Edo rule had in 1868 at last come to an end—682 years since Minamoto Yoritomo organized the feudal government of the empire.