The election takes place as the war in Iran continues to send gas prices soaring, creating an unanticipated windfall in the nation’s No. 2 oil-producing state that the new governor will play a key role in managing.

Candidates for New Mexico governor and other top state and federal offices will compete for their parties’ nominations in a state primary on Tuesday.

New Mexicans are choosing Democratic and Republican nominees for governor as the state grapples with high rates of violent crime, chronically underperforming schools and cuts to…