In the meantime, the Allies learned in July that the Japanese had begun building an airfield on Guadalcanal. Operating from this base the Japanese would threaten the shipping supply routes to Australia. To prevent this from occurring, the U.S. chose Tulagi and nearby Guadalcanal as the target of their first offensive. The failure of the Japanese to take Port Moresby, and their defeat at Midway, had the effect of dangling their base at Tulagi and Guadalcanal without effective protection from other Japanese bases. Tulagi and Guadalcanal were four hours flying time from Rabaul, the nearest large Japanese base.