In the 1850s, Japan was forced to give up its isolationism and begin to trade with the rest of the world. In 1860s, conflicts between liberals and conservatives escalated, and in 1868 the Meiji Emperor was put on the throne and the shogunate was abolished.
Japan rapidly industrialized, reorganizing their army along European lines and building modern ships for their navy. The Diet, a parliament, was established, and democracy was tentatively implemented. Japan gained suzerainty over Korea in the First Sino-Japanese War of 1895, and was of a member of the Eight Nation Army in the Boxer Rebellion.
The Russo-Japanese War of 1904-1905 proved to be a turning point. At the Battle of Tsushima, the Japanese navy defeated the Russian fleet that had sailed halfway around the globe to meet them. The Japanese victory was confirmed at the Treaty of Portsmouth in 1905, orchestrated by U.S. President Theodore Roosevelt. However, Japan was not accepted into the ranks of the Western powers due to racism.
In World War I, Japan was a member of the Allied Powers. Japan took several German ports in China, and several German colonies in the Pacific. At the Treaty of Versailles in 1919, Japan was poorly compensated for her efforts.
The Japanese democracy was steadily dismantled in the 1920s and 1930s. A military government led by Hideki Tojo came into power, and began an aggressive expansionist policy. In 1931, Japan invaded Manchuria, and in 1937 instigated a full-blown war against China.
Japan entered World War II on the side of the Axis Powers on December 7, 1941, with the attack on Pearl Harbor. The Japanese military and economy needed to import raw resources, and the U.S. embargo prevented this. After an initial period of military successes in Southeast Asia, Japan was turned back by the industrial might of the United States at the Battle of Midway, among others.
The advance on the Home Islands culminated in the atomic bombings of Hiroshima and Nagasaki in August 1945. This, along with the Soviet invasion of Manchuria, resulted in the Japanese surrender on September 2, 1945. Most of the military government's leading figures were tried and convicted, but the emperor, Hirohito, was allowed to remain. Japan swiftly transformed itself into an American ally and an industrial powerhouse.