Before the beginning of the Second World War, Japan was fighting with China. This is called Second Sino-Japanese War (1937-1945). When the Second World War broke out in 1939, Japan went to the side of Nazi Germany and Fascist Italy. Japanese planes attacked Pearl Harbor on December 7, 1941. The fighting continued for years. When the USA dropped the first atomic bombs on the Japanese cities of Hiroshima and Nagasaki, Japan accepted defeat and surrendered in 1945.