Rather than seek re-election to a third term, Ayers opted to run for governor in 1936, and narrowly defeated incumbent governor Elmer Holt in the Democratic primary. In the general election, he barely defeated former Lieutenant Governor of Montana Frank Hazelbaker, the Republican nominee. During his administration, he oversaw the expansion of the state bureaucracy, signed a bill to give the governor new powers in directing state government, the state deficit was eliminated, and state bond interests were lowered. When he ran for re-election in 1940, he only won the Democratic primary with a thin plurality, and was defeated in the general election by Sam C. Ford, a former Montana Supreme Court Associate Justice. He ran in the Democratic primary to challenge Ford in 1944, but came in third behind Leif Erickson and Austin B. Middleton.