The Battle of the Coral Sea off New Guinea in May 1942 was the first naval engagement in which an IJN offensive operation was thwarted. At the Battle of Midway in June, another planned Japanese invasion was blocked. IJN lost four fleet carriers at Midway, resulting in the IJN never again undertaking a successful major initiative. IJN's Aleutian Islands campaign, also in June, was tactically successful but of little consequence. In July, the IJA began its campaign over the Kokoda Trail to take Port Moresby, but in its first major defeat of the war, Japanese troops were stopped and turned around in September by Australian troops. The Battle of Milne Bay in August was the first time Allied troops successfully resisted a Japanese amphibious assault, forcing the Japanese troops that had landed to withdraw. The Battle of Guadalcanal lasted from August 1942 to February 1943 and was the first successful Allied offensive of significance in the Pacific. The Allies took Buna and Gona on the northern New Guinea coast between November 1944 and January 1945. Thus, within a year of the Pearl Harbor attack, the strategic initiative had passed from Japan to the Allies. This shift was achieved largely by strategic Allied navy gambles against a superior Japanese navy before America's massive shipbuilding program was brought to bear.