The 1940 Montana gubernatorial election took place on November 5, 1940. Incumbent governor of Montana Roy E. Ayers, who was first elected governor in 1936, ran for re-election. He narrowly won the Democratic primary by just over a thousand votes to win renomination, and advanced to the general election, where he was opposed by Sam C. Ford, a former Associate Justice of the Montana Supreme Court and the Republican nominee. Ultimately, in spite of the fact that then-President Franklin D. Roosevelt comfortably won the state in that year's presidential election, Ford narrowly defeated Ayers to win his first of two terms as governor.
Democratic primary.
Results.
! scope="col" colspan="2" style="width: 15em" |Party
! scope="col" style="width: 17em" |Candidate
! scope="col" style="width: 5em" |Votes
! scope="col" style="width: 3.5em" |%
! colspan="3" style="text-align:right;" | Total votes
Republican primary.
Results.
! scope="col" colspan="2" style="width: 15em" |Party
! scope="col" style="width: 17em" |Candidate
! scope="col" style="width: 5em" |Votes
! scope="col" style="width: 3.5em" |%
! colspan="3" style="text-align:right;" | Total votes
General election.
Results.
! scope="col" colspan="2" style="width: 130px"|Party
! scope="col" style="width: 17em"|Candidate
! scope="col" style="width: 5em"|Votes
! scope="col" style="width: 3.5em"|%
! scope="col" style="width: 3.5em"| ;templatestyles src="Template:Tooltip/styles.css" / ;±%
! colspan="3" style="text-align: right; margin-right: 0.5em" | Majority
! colspan="3" style="text-align: right; margin-right: 0.5em" scope=row | Turnout
! style="text-align:right;" | Swing
References.
 ;templatestyles src="Reflist/styles.css" / ;