Imperial Japanese forces defeat the remnants of the Tokugawa shogunate in the Battle of Hakodate to end the Boshin War.

The Battle of Hakodate (, Hakodate Sens) was fought in Japan from December 4, 1868 to June 27, 1869, between the remnants of the Tokugawa shogunate army, consolidated into the armed forces of the rebel Ezo Republic, and the armies of the newly formed Imperial government (composed mainly of forces of the Chsh and the Satsuma domains). It was the last stage of the Boshin War, and occurred around Hakodate in the northern Japanese island of Hokkaid. In Japanese, it is also known as the Battle of Goryokaku (, Goryokaku no tatakai)

According to the Japanese calendar, the Battle of Hakodate was fought from Meiji-1 year (gannen), 10-month, 21-day until Meiji-2 year, 5-month 18-day.

The Empire of Japan was a historical nation-state and great power that existed from the Meiji Restoration in 1868 until the enactment of the post-World War II 1947 constitution and subsequent formation of modern Japan. It encompassed the Japanese archipelago and several colonies, protectorates, mandates, and other territories.

Under the slogans of fukoku kyōhei and shokusan kōgyō, Japan underwent a period of industrialization and militarization, the Meiji Restoration being the fastest modernisation of any country to date, all of these aspects contributed to Japan's emergence as a great power and the establishment of a colonial empire following the First Sino-Japanese War, the Boxer Rebellion, the Russo-Japanese War, and World War I. Economic and political turmoil in the 1920s, including the Great Depression, led to the rise of militarism, nationalism and totalitarianism as embodied in the Showa Statism ideology, eventually culminating in Japan's membership in the Axis alliance and the conquest of a large part of the Asia-Pacific in World War II.Japan's armed forces initially achieved large-scale military successes during the Second Sino-Japanese War (1937–1945) and the Pacific War. However, starting from 1942, particularly after the Battles of Midway and Guadalcanal, Japan was forced to adopt a defensive stance, and the American island hopping campaign meant that Japan was slowly losing all of the territory it had gained, and eventually, the Americans captured Iwo Jima and Okinawa Island, leaving the Japanese mainland completely unprotected. The U.S. forces had planned an invasion, but Japan surrendered following the atomic bombings of Hiroshima and Nagasaki and the nearly simultaneous Soviet declaration of war on August 9, 1945, and subsequent invasion of Manchuria and other territories. The Pacific War officially came to a close on September 2, 1945. A period of occupation by the Allies followed. In 1947, with American involvement, a new constitution was enacted, officially bringing the Empire of Japan to an end, and Japan's Imperial Army was replaced with the Japan Self-Defense Forces. Occupation and reconstruction continued until 1952, eventually forming the current constitutional monarchy known as Japan.

The Empire of Japan had three emperors, although it came to an end partway through Shōwa's reign. The emperors were given posthumous names, and the emperors are as follows: Meiji, Taisho, and Shōwa.