LOS ANGELES – Gas prices are creeping up nationally, now pennies a gallon away from their highest level since 2014, just in time for the November midterm elections when California will vote on rolling back its gas tax.

Average prices topped $2.91 a gallon for unleaded Thursday for the first time since June, having risen 7 cents a gallon in the past month, AAA reports.

If they rise by about another seven cents, they will be the highest in four years.

That could spell trouble in the midterm elections Nov. 6 since voters often have gas prices in mind when they cast ballots. In California, second only to Hawaii as the state with the highest fuel prices, voters will decide whether to repeal a gas surtax that raises $5.1 billion a year for road and bridge repair and public transit. Opponents of the tax say the state is already spending enough, especially with total taxes of 95.5 cents on every gallon.

Gas prices are rising nationally because strengthening global economies and international politics have boosted oil prices.

"It's been about demand growth worldwide," said Tom Kloza, global head of energy analysis for the Oil Price Information Service. And when it comes to sanctions on Iran, a major oil producer, "there's no shortage of scary comments" that inject fear into the market and drive up prices further.

More:10 memorable gas stations that offer more than fuel

More:U.S.-imposed sanctions on Iranian oil industry will 'cripple' Iran's economy, report says

More:The best gas station coffee in every state (2018)

The Trump administration is in the process of re-instituting sanctions on Iran after pulling out of an agreement negotiated under President Barack Obama that would limit that nation's nuclear development. After hitting four-year highs this week, the benchmark U.S. crude fell 2.9 percent Thursday to $74.23 a barrel in trading in New York.

OPEC, the international oil cartel, is hoping for rising prices as it heads toward a Dec. 6 meeting, said Patrick DeHaan, senior petroleum analyst for GasBuddy.com. He noted, however, that gas prices usually fall after the peak summer driving season, not rise.

"I think we have a pretty good shot at seeing $3 a gallon if the OPEC or Iran (situations) continue to fan the flames," DeHaan said.

In California, perennially the top state for gasoline consumption, prices will only have to rise another penny a gallon to hit their highest level since July, 2015, he said. On Thursday, self-serve unleaded averaged $3.78.

If prices hold or rise further through election day, that might help proponents of repealing an excise tax that went into effect last year that added 12 cents to every gallon in the Golden State.

A repeal could ricochet into similar movements around the country: "At least 10 states in the last few years have increased their gas taxes," DeHaan said.

In a rally Wednesday near Los Angeles International Airport, Mayor Eric Garcetti said that in Los Angeles alone, the excise tax is funding billions in dollars in transportation projects – from replacing aging bridges to filling potholes.

"I would rather pay a few cents more at the pump than a lot more money to a mechanic" to repair pothole damage, Garcetti said.

Contributing: Associated Press