This act of violence led to civil war. In August, 1864, the capital was attacked by a body of thirteen hundred men of the Choshiu and other disaffected clans. It was defended by the adherents of the shogun, now the supporters of the mikado. For two days the battle raged, and at the end of that time a great part of the city was a heap of ashes, some thirty thousand edifices being destroyed by the flames. "The Blossom Capital became a scorched desert." The Choshiu were defeated, but Kioto lay in ruins. A Japanese city is like a house of card-board, easily destroyed, and almost as easily rebuilt.

This conflict was followed by a march in force upon Choshiu to punish its rebellious people. The expedition was not a popular one. Some powerful feudal lords refused to join it. Of those mustered into the ranks many became conveniently sick, and those who marched were disorganized and without heart for the fight. Choshiu, on the contrary, was well prepared. The clansmen, who had long been in contact with the Dutch, had thrown aside the native weapons, were drilled in European tactics, and were well armed with rifles and artillery. The result was, after a three months' campaign, the complete defeat of the invading army, and an almost fatal blow to the prestige of the shogun. This defeat was immediately followed by the death of the young shogun, who had been worn out by the intense anxiety of his period of rule.

He was succeeded by the last of the shoguns, Keiki, appointed head of the Tokugawa family in October, 1866, and shogun in January, 1867. This position he had frequently declined. He was far too weak and fickle a man to hold it at such a time. He was popular at court because of his opposition to the admission of the foreigners, but he was by no means the man to hold the reins of government at that perilous juncture of affairs.

In fact, he had hardly accepted the office when a vigorous pressure was brought upon him to resign, in which a number of princes and powerful noblemen took part. It was their purpose to restore the ancient government of the realm. Keiki yielded, and in November, 1867, resigned his high office of Sei-i Tai Shogun. During this critical interval the mikado had died, and a new youthful emperor had been raised to the throne.

But the imperial power was not so easily to be restored, after its many centuries of abrogation. The Aidzu, the most loyal of all the clans to the shogun, and the leaders in the war against the Choshiu, guarded the palace gates, and for the time being were masters of the situation. Meanwhile the party of the mikado was not idle. Gradually small parties of soldiers were sent by them to the capital, and a quiet influence was brought to bear to induce the court to take advantage of the opportunity and by a bold movement abolish the office of shogun and declare the young emperor the sole sovereign of the realm.

This coup-d'état was effected January 3, 1868. On that day the introduced troops suddenly took possession of the palace gates, the nobles who surrounded the emperor were dismissed and replaced by others favorable to the movement, and an edict was issued in the name of the mikado declaring the office of shogun abolished, and that the sole government of the empire lay in the hands of the mikado and his court. New offices were established and new officials chosen to fill them, the clan of Choshiu was relieved from the ban of rebellion and honored as the supporter of the imperial power, and a completely new government was organized.

This decisive action led to civil war. The adherents of the Tokugawa clan, in high indignation at this revolutionary act, left the capital, Keiki, who now sought to seize his power again, at their head. On the 27th of February he marched upon Kioto with an army of ten thousand, or, as some say, thirty thousand, men. The two roads leading to the capital had been barricaded, and were defended by two thousand men, armed with artillery.

A fierce battle followed, lasting for three days. Greatly as the defenders of the barriers were outnumbered, their defences and artillery, with their European discipline, gave them the victory. The shogun was defeated, and fled with his army to Ozaka, the castle of which was captured and burned, while he took refuge on an American vessel in the harbor. Making his way thence to Yedo in one of his own ships, he shut himself up in his palace, once more with the purpose of withdrawing from the struggle.

His retainers and many of the daimios and clans urged him to continue the war, declaring that, with the large army and abundant supplies at his command, and the powerful fleet under his control, they could restore him to the position he had lost. But Keiki had had enough of war, and could not bear the idea of being a rebel against his liege lord. Declaring that he would never take up arms against the mikado, he withdrew from the struggle to private life.

In the mean time the victorious forces of the south had reached the suburbs of Yedo, and were threatening to apply the torch to that tinder-box of a city unless it were immediately surrendered. Their commander, being advised of the purpose of the shogun, promised to spare the city, but assailed and burned the magnificent temple of Uyeno, in which the rebels still in arms had taken refuge. For a year longer the war went on, victory everywhere favoring the imperial army. By the 1st of July, 1869, hostilities were at an end, and the mikado was the sole lord of the realm.