The Battle of Midway was a key naval battle between the Japanese and United States in early June, 1942. The Japanese planned on luring U.S. aircraft carriers into a trap and occupying Midway Atoll, which would give them a greater defensive perimeter in the Pacific. However, U.S. cryptoanalysts had cracked the Japanese communications code and were able to provide U.S. naval commanders with vital intelligence as to Japanese intentions and military strength. With this intelligence, the U.S. Navy decided to spring a trap of their own and engage the Japanese on their terms. The resulting battle was a decisive victory for the U.S. Navy. Japan's fleet was crippled to the point of irreversible damage; even more so after the Battle of Guadalcanal. Japan lost four of its aircraft carriers at Midway - all of which had been involved in the Pearl Harbor attack. Because of the devastation to the Japanese navy at Midway, Japan would suffer from the inability to adequately replace its warships and pilots for the rest of the war.