Yamato was the lead ship of her class of battleships built for the Imperial Japanese Navy (IJN) shortly before World War II. She and her sister ship, , were the heaviest and most powerfully armed battleships ever constructed, displacing nearly at full load and armed with nine Type 94 main guns, which were the largest guns ever mounted on a warship. Named after the ancient Japanese Yamato Province, Yamato was designed to counter the numerically superior battleship fleet of the United States, Japan's main rival in the Pacific. She was laid down in 1937 and formally commissioned a week after the attack on Pearl Harbor in December 1941. Throughout 1942, she served as the flagship of the Combined Fleet, and in June 1942 Admiral Isoroku Yamamoto directed the fleet from her bridge during the Battle of Midway, a disastrous defeat for Japan. Musashi took over as the Combined Fleet flagship in early 1943, and Yamato spent the rest of the year moving between the major Japanese naval bases of Truk and Kure in response to American threats. In December 1943, Yamato was torpedoed by an American submarine which necessitated repairs at Kure, where she would also be refitted with additional anti-aircraft guns and radar in early 1944. Although present at the Battle of the Philippine Sea in June 1944, she played no part in the battle. The only time Yamato fired her main guns at enemy surface targets was in October 1944, when she was sent to engage American forces invading the Philippines during the Battle of Leyte Gulf. While threatening to sink American troop transports, they encountered a light escort carrier group of the U.S. Navy's Task Force 77, "Taffy 3", in the Battle off Samar. The Japanese turned back after American air attacks convinced them they were engaging a powerful US carrier fleet. During 1944, the balance of naval power in the Pacific decisively turned against Japan, and by early 1945, its fleet was much depleted and badly hobbled by critical fuel shortages in the home islands.