His first shore duty was at the Naval Academy. Beginning in 1907, he served as instructor in the Department of Physics and Chemistry for two years. He went to sea in 1909 and served as navigator of the armored cruiser in the Pacific Fleet. On October 18, 1911, Lt. Cmdr. Leahy served as naval aide to President William Howard Taft, at the laying of the keel of , at Mare Island. During the American Occupation of Nicaragua in 1912, he was Chief of Staff to the Commander, Naval Forces there.