quality:correction, linguistic:paraphrasing
Bakumatsu modernization and conflicts

During the last years of the bakufu, or bakumatsu, the bakufu took strong measures to try to reassert its dominance, although its involvement with modernization and foreign powers was to make it a target of anti-Western sentiment throughout the country.

The army and the navy were modernized. A naval training school was established in Nagasaki in 1855. Naval students were sent to study in Western naval schools for several years, starting a tradition of foreign-educated future leaders, such as Admiral Enomoto. French naval engineers were hired to build naval arsenals, such as Yokosuka and Nagasaki. By the end of the Tokugawa shogunate in 1868, the Japanese navy of the shōgun already possessed eight Western-style steam warships around the flagship Kaiyō Maru, which were used against pro-imperial forces during the Boshin War under the command of Admiral Enomoto. A French military mission was established to help modernize the armies of the bakufu.

Revering the emperor as a symbol of unity, extremists wrought violence and death against the Bakufu and Han authorities and foreigners. Foreign naval retaliation in the Anglo-Satsuma War led to still another concessionary commercial treaty in 1865, but Yoshitomi was unable to enforce the Western treaties. A bakufu army was defeated when it was sent to crush dissent in the Satsuma and Chōshū Domains in 1866. Finally, in 1867, Emperor Kōmei died and was succeeded by his underaged son Emperor Meiji.

Tokugawa Yoshinobu reluctantly became head of the Tokugawa house and shōgun. He tried to reorganize the government under the emperor while preserving the shōgun ' s leadership role. Fearing the growing power of the Satsuma and Chōshū daimyo, other daimyo called for returning the shōgun ' s political power to the emperor and a council of daimyo chaired by the former Tokugawa shōgun. Yoshinobu accepted the plan in late 1867 and resigned, announcing an "imperial restoration". The Satsuma, Chōshū, and other han leaders and radical courtiers, however, rebelled, seized the imperial palace, and announced their own restoration on January 3, 1868.

Following the Boshin War (1868–1869), the bakufu was abolished, and Yoshinobu was reduced to the ranks of the common daimyo. Resistance continued in the North throughout 1868, and the bakufu naval forces under Admiral Enomoto Takeaki continued to hold out for another six months in Hokkaidō, where they founded the short-lived Republic of Ezo.

Although the Edo Period would soon end, Bushido values would continue to influence Japanese society long after the samurai ceased to exist.

The Edo Period would also have a lasting impact on modern art and culture. The Edo Period lives on in plays, books, anime, and especially jidaigeki (historical period dramas), such as the classic samurai films of Akira Kurosawa. Kurosawa's films would influence Spaghetti Westerns, and even Star Wars.